class A:
    def __init__(self, txt: str):
        self.o: E = None
        self.q: F = None
        self.r: C = None
        self.v: E = None
        self.txt = txt

class B:
    def __init__(self, txt: str):
        self.t: F = None
        self.y: E = None
        self.q: C = None
        self.w: D = None
        self.z: D = None
        self.s: A = None
        self.txt = txt

class C:
    def __init__(self, txt: str):
        self.z: D = None
        self.y: E = None
        self.txt = txt

class D:
    def __init__(self, txt: str):
        self.u: B = None
        self.s: F = None
        self.txt = txt

class E:
    def __init__(self, txt: str):
        self.v: G = None
        self.q: E = None
        self.t: B = None
        self.o: F = None
        self.p: D = None
        self.x: F = None
        self.r: B = None
        self.txt = txt

class F:
    def __init__(self, txt: str):
        self.y: D = None
        self.w: B = None
        self.o: C = None
        self.s: A = None
        self.q: D = None
        self.r: G = None
        self.x: E = None
        self.txt = txt

class G:
    def __init__(self, txt: str):
        self.z: A = None
        self.u: C = None
        self.txt = txt

d = A("d")
f = B("f")
n = C("n")
k = D("k")
m = E("m")
l = F("l")
h = G("h")
c = E("c")

d.o = m
d.q = l
d.r = n
d.v = c
f.t = l
f.y = c
f.q = n
f.w = k
f.z = k
f.s = d
n.z = k
n.y = c
k.u = f
k.s = l
m.v = h
m.q = c
m.t = f
m.r = f
m.o = l
m.x = l
m.p = k
l.y = k
l.q = k
l.w = f
l.o = n
l.s = d
l.r = h
l.x = c
h.z = d
h.u = n
c.v = h
c.q = m
c.t = f
c.r = f
c.o = l
c.x = l
c.p = k
assert d.o.p.s.r.z.r.y.txt == "
class A:
    def __init__(self, txt: str):
        self.o: E = None
        self.q: F = None
        self.r: C = None
        self.v: E = None
        self.txt = txt

class B:
    def __init__(self, txt: str):
        self.t: F = None
        self.y: E = None
        self.q: C = None
        self.w: D = None
        self.z: D = None
        self.s: A = None
        self.txt = txt

class C:
    def __init__(self, txt: str):
        self.z: D = None
        self.y: E = None
        self.txt = txt

class D:
    def __init__(self, txt: str):
        self.u: B = None
        self.s: F = None
        self.txt = txt

class E:
    def __init__(self, txt: str):
        self.v: G = None
        self.q: E = None
        self.t: B = None
        self.o: F = None
        self.p: D = None
        self.x: F = None
        self.r: B = None
        self.txt = txt

class F:
    def __init__(self, txt: str):
        self.y: D = None
        self.w: B = None
        self.o: C = None
        self.s: A = None
        self.q: D = None
        self.r: G = None
        self.x: E = None
        self.txt = txt

class G:
    def __init__(self, txt: str):
        self.z: A = None
        self.u: C = None
        self.txt = txt

d = A("d")
f = B("f")
n = C("n")
k = D("k")
m = E("m")
l = F("l")
h = G("h")
c = E("c")

d.o = m
d.q = l
d.r = n
d.v = c
f.t = l
f.y = c
f.q = n
f.w = k
f.z = k
f.s = d
n.z = k
n.y = c
k.u = f
k.s = l
m.v = h
m.q = c
m.t = f
m.r = f
m.o = l
m.x = l
m.p = k
l.y = k
l.q = k
l.w = f
l.o = n
l.s = d
l.r = h
l.x = c
h.z = d
h.u = n
c.v = h
c.q = m
c.t = f
c.r = f
c.o = l
c.x = l
c.p = k
assert d.o.p.s.r.z.r.y.txt == "c"