class A:
    def __init__(self, txt: str):
        self.r: E = None
        self.p: D = None
        self.x: E = None
        self.q: B = None
        self.u: C = None
        self.t: D = None
        self.txt = txt

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

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

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

class E:
    def __init__(self, txt: str):
        self.z: F = None
        self.txt = txt

class F:
    def __init__(self, txt: str):
        self.u: D = None
        self.p: B = None
        self.w: B = None
        self.x: A = None
        self.txt = txt

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

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

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

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

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

class E:
    def __init__(self, txt: str):
        self.z: F = None
        self.txt = txt

class F:
    def __init__(self, txt: str):
        self.u: D = None
        self.p: B = None
        self.w: B = None
        self.x: A = None
        self.txt = txt

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

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