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

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

class C:
    def __init__(self, txt: str):
        self.x: F = None
        self.txt = txt

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

class E:
    def __init__(self, txt: str):
        self.s: E = None
        self.t: F = None
        self.p: C = None
        self.u: A = None
        self.q: E = None
        self.txt = txt

class F:
    def __init__(self, txt: str):
        self.x: B = None
        self.txt = txt

l = A("l")
e = B("e")
i = C("i")
f = D("f")
d = E("d")
a = F("a")
h = A("h")
c = E("c")

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

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

class C:
    def __init__(self, txt: str):
        self.x: F = None
        self.txt = txt

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

class E:
    def __init__(self, txt: str):
        self.s: E = None
        self.t: F = None
        self.p: C = None
        self.u: A = None
        self.q: E = None
        self.txt = txt

class F:
    def __init__(self, txt: str):
        self.x: B = None
        self.txt = txt

l = A("l")
e = B("e")
i = C("i")
f = D("f")
d = E("d")
a = F("a")
h = A("h")
c = E("c")

l.q = i
l.t = a
l.s = c
e.o = i
e.z = d
i.x = a
f.y = l
f.w = l
f.r = d
f.z = h
d.s = c
d.q = c
d.t = a
d.p = i
d.u = l
a.x = e
h.q = i
h.t = a
h.s = d
c.s = d
c.q = d
c.t = a
c.p = i
c.u = l
assert a.x.o.x.txt == "a"