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

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

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

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

class E:
    def __init__(self, txt: str):
        self.z: B = None
        self.t: C = None
        self.q: F = None
        self.w: C = None
        self.txt = txt

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

j = A("j")
a = B("a")
e = C("e")
f = D("f")
b = E("b")
h = F("h")
k = F("k")
d = B("d")

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

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

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

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

class E:
    def __init__(self, txt: str):
        self.z: B = None
        self.t: C = None
        self.q: F = None
        self.w: C = None
        self.txt = txt

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

j = A("j")
a = B("a")
e = C("e")
f = D("f")
b = E("b")
h = F("h")
k = F("k")
d = B("d")

j.r = b
j.t = b
j.p = f
a.u = f
e.x = a
e.u = j
e.v = j
e.p = k
e.r = f
f.y = b
f.u = b
b.z = d
b.t = e
b.w = e
b.q = k
h.w = b
h.s = b
h.y = k
h.p = d
h.z = j
k.w = b
k.s = b
k.y = h
k.p = a
k.z = j
d.u = f
assert e.u.p.y.q.txt == "k"