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

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

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

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

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

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

h = A("h")
l = B("l")
k = C("k")
c = D("c")
j = E("j")
e = F("e")

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

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

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

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

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

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

h = A("h")
l = B("l")
k = C("k")
c = D("c")
j = E("j")
e = F("e")

h.o = k
h.w = k
h.p = k
h.r = e
h.x = c
l.u = h
l.z = j
l.v = c
k.z = l
c.p = j
c.t = e
c.x = k
c.q = k
c.u = l
j.z = e
j.o = k
e.p = k
e.x = l
e.w = j
e.q = j
e.t = c
e.o = h
assert k.z.u.r.txt == "e"