class A:
    def __init__(self, txt: str):
        self.x: D = None
        self.z: B = None
        self.s: H = None
        self.txt = txt

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

class C:
    def __init__(self, txt: str):
        self.o: H = None
        self.txt = txt

class D:
    def __init__(self, txt: str):
        self.t: F = None
        self.p: A = None
        self.txt = txt

class E:
    def __init__(self, txt: str):
        self.z: G = None
        self.x: F = None
        self.y: D = None
        self.q: B = None
        self.txt = txt

class F:
    def __init__(self, txt: str):
        self.o: H = None
        self.u: E = None
        self.txt = txt

class G:
    def __init__(self, txt: str):
        self.u: D = None
        self.txt = txt

class H:
    def __init__(self, txt: str):
        self.y: F = None
        self.txt = txt

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

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

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

class C:
    def __init__(self, txt: str):
        self.o: H = None
        self.txt = txt

class D:
    def __init__(self, txt: str):
        self.t: F = None
        self.p: A = None
        self.txt = txt

class E:
    def __init__(self, txt: str):
        self.z: G = None
        self.x: F = None
        self.y: D = None
        self.q: B = None
        self.txt = txt

class F:
    def __init__(self, txt: str):
        self.o: H = None
        self.u: E = None
        self.txt = txt

class G:
    def __init__(self, txt: str):
        self.u: D = None
        self.txt = txt

class H:
    def __init__(self, txt: str):
        self.y: F = None
        self.txt = txt

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

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