class A:
    def __init__(self, txt: str):
        self.z: A = None
        self.w: C = None
        self.r: B = None
        self.txt = txt

class B:
    def __init__(self, txt: str):
        self.v: F = None
        self.y: G = None
        self.o: G = None
        self.txt = txt

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

class D:
    def __init__(self, txt: str):
        self.x: H = None
        self.v: G = None
        self.y: C = None
        self.u: E = None
        self.txt = txt

class E:
    def __init__(self, txt: str):
        self.w: D = None
        self.q: F = None
        self.txt = txt

class F:
    def __init__(self, txt: str):
        self.p: G = None
        self.s: D = None
        self.x: C = None
        self.y: D = None
        self.o: H = None
        self.u: G = None
        self.txt = txt

class G:
    def __init__(self, txt: str):
        self.y: A = None
        self.w: C = None
        self.t: C = None
        self.s: A = None
        self.v: C = None
        self.o: E = None
        self.txt = txt

class H:
    def __init__(self, txt: str):
        self.q: E = None
        self.x: D = None
        self.txt = txt

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

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

class B:
    def __init__(self, txt: str):
        self.v: F = None
        self.y: G = None
        self.o: G = None
        self.txt = txt

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

class D:
    def __init__(self, txt: str):
        self.x: H = None
        self.v: G = None
        self.y: C = None
        self.u: E = None
        self.txt = txt

class E:
    def __init__(self, txt: str):
        self.w: D = None
        self.q: F = None
        self.txt = txt

class F:
    def __init__(self, txt: str):
        self.p: G = None
        self.s: D = None
        self.x: C = None
        self.y: D = None
        self.o: H = None
        self.u: G = None
        self.txt = txt

class G:
    def __init__(self, txt: str):
        self.y: A = None
        self.w: C = None
        self.t: C = None
        self.s: A = None
        self.v: C = None
        self.o: E = None
        self.txt = txt

class H:
    def __init__(self, txt: str):
        self.q: E = None
        self.x: D = None
        self.txt = txt

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

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