class A:
    def __init__(self, txt: str):
        self.z: F = None
        self.r: C = None
        self.x: D = None
        self.o: E = None
        self.txt = txt

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

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

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

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

class F:
    def __init__(self, txt: str):
        self.v: A = None
        self.w: B = None
        self.z: D = None
        self.y: D = None
        self.p: C = None
        self.txt = txt

d = A("d")
a = B("a")
j = C("j")
e = D("e")
l = E("l")
h = F("h")

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

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

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

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

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

class F:
    def __init__(self, txt: str):
        self.v: A = None
        self.w: B = None
        self.z: D = None
        self.y: D = None
        self.p: C = None
        self.txt = txt

d = A("d")
a = B("a")
j = C("j")
e = D("e")
l = E("l")
h = F("h")

d.z = h
d.r = j
d.x = e
d.o = l
a.q = j
j.r = a
j.s = a
j.v = d
j.z = e
e.r = l
e.w = h
e.v = j
l.w = h
l.x = e
l.u = d
h.v = d
h.w = a
h.z = e
h.y = e
h.p = j
assert a.q.z.w.txt == "h"