class A:
    def __init__(self, txt: str):
        self.x: B = None
        self.t: B = None
        self.y: B = None
        self.z: C = None
        self.txt = txt

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

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

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

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

class F:
    def __init__(self, txt: str):
        self.u: D = None
        self.x: E = None
        self.q: D = None
        self.s: B = None
        self.txt = txt

m = A("m")
a = B("a")
c = C("c")
j = D("j")
b = E("b")
e = F("e")
i = F("i")
h = F("h")

m.x = a
m.t = a
m.y = a
m.z = c
a.r = c
a.z = h
c.t = a
c.s = b
c.p = j
j.v = c
j.q = c
j.r = c
j.z = c
j.x = a
j.p = b
b.v = j
b.x = m
e.u = j
e.q = j
e.x = b
e.s = a
i.u = j
i.q = j
i.x = b
i.s = a
h.u = j
h.q = j
h.x = b
h.s = a
assert e.q.r.s.txt == "
class A:
    def __init__(self, txt: str):
        self.x: B = None
        self.t: B = None
        self.y: B = None
        self.z: C = None
        self.txt = txt

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

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

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

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

class F:
    def __init__(self, txt: str):
        self.u: D = None
        self.x: E = None
        self.q: D = None
        self.s: B = None
        self.txt = txt

m = A("m")
a = B("a")
c = C("c")
j = D("j")
b = E("b")
e = F("e")
i = F("i")
h = F("h")

m.x = a
m.t = a
m.y = a
m.z = c
a.r = c
a.z = h
c.t = a
c.s = b
c.p = j
j.v = c
j.q = c
j.r = c
j.z = c
j.x = a
j.p = b
b.v = j
b.x = m
e.u = j
e.q = j
e.x = b
e.s = a
i.u = j
i.q = j
i.x = b
i.s = a
h.u = j
h.q = j
h.x = b
h.s = a
assert e.q.r.s.txt == "b"