class A:
    def __init__(self, txt: str):
        self.r: H = None
        self.s: H = None
        self.q: C = None
        self.w: C = None
        self.txt = txt

class B:
    def __init__(self, txt: str):
        self.v: G = None
        self.x: G = None
        self.p: F = None
        self.z: G = None
        self.o: C = None
        self.txt = txt

class C:
    def __init__(self, txt: str):
        self.z: D = None
        self.x: B = None
        self.v: B = None
        self.s: E = None
        self.p: B = None
        self.txt = txt

class D:
    def __init__(self, txt: str):
        self.w: G = None
        self.z: G = None
        self.p: H = None
        self.r: B = None
        self.u: B = None
        self.t: E = None
        self.txt = txt

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

class F:
    def __init__(self, txt: str):
        self.t: C = None
        self.w: D = None
        self.q: A = None
        self.o: G = None
        self.y: H = None
        self.txt = txt

class G:
    def __init__(self, txt: str):
        self.w: B = None
        self.q: E = None
        self.p: A = None
        self.txt = txt

class H:
    def __init__(self, txt: str):
        self.q: B = None
        self.txt = txt

i = A("i")
b = B("b")
f = C("f")
l = D("l")
d = E("d")
e = F("e")
j = G("j")
g = H("g")
m = F("m")

i.r = g
i.s = g
i.q = f
i.w = f
b.v = j
b.x = j
b.z = j
b.p = m
b.o = f
f.z = l
f.x = b
f.v = b
f.p = b
f.s = d
l.w = j
l.z = j
l.p = g
l.r = b
l.u = b
l.t = d
d.t = i
d.r = l
d.x = l
d.o = b
d.q = b
d.v = g
e.t = f
e.w = l
e.q = i
e.o = j
e.y = g
j.w = b
j.q = d
j.p = i
g.q = b
m.t = f
m.w = l
m.q = i
m.o = j
m.y = g
assert e.t.x.o.s.txt == "
class A:
    def __init__(self, txt: str):
        self.r: H = None
        self.s: H = None
        self.q: C = None
        self.w: C = None
        self.txt = txt

class B:
    def __init__(self, txt: str):
        self.v: G = None
        self.x: G = None
        self.p: F = None
        self.z: G = None
        self.o: C = None
        self.txt = txt

class C:
    def __init__(self, txt: str):
        self.z: D = None
        self.x: B = None
        self.v: B = None
        self.s: E = None
        self.p: B = None
        self.txt = txt

class D:
    def __init__(self, txt: str):
        self.w: G = None
        self.z: G = None
        self.p: H = None
        self.r: B = None
        self.u: B = None
        self.t: E = None
        self.txt = txt

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

class F:
    def __init__(self, txt: str):
        self.t: C = None
        self.w: D = None
        self.q: A = None
        self.o: G = None
        self.y: H = None
        self.txt = txt

class G:
    def __init__(self, txt: str):
        self.w: B = None
        self.q: E = None
        self.p: A = None
        self.txt = txt

class H:
    def __init__(self, txt: str):
        self.q: B = None
        self.txt = txt

i = A("i")
b = B("b")
f = C("f")
l = D("l")
d = E("d")
e = F("e")
j = G("j")
g = H("g")
m = F("m")

i.r = g
i.s = g
i.q = f
i.w = f
b.v = j
b.x = j
b.z = j
b.p = m
b.o = f
f.z = l
f.x = b
f.v = b
f.p = b
f.s = d
l.w = j
l.z = j
l.p = g
l.r = b
l.u = b
l.t = d
d.t = i
d.r = l
d.x = l
d.o = b
d.q = b
d.v = g
e.t = f
e.w = l
e.q = i
e.o = j
e.y = g
j.w = b
j.q = d
j.p = i
g.q = b
m.t = f
m.w = l
m.q = i
m.o = j
m.y = g
assert e.t.x.o.s.txt == "d"