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

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

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

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

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

class F:
    def __init__(self, txt: str):
        self.q: E = None
        self.x: E = None
        self.y: B = None
        self.w: B = None
        self.r: A = None
        self.txt = txt

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

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

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

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

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

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

class F:
    def __init__(self, txt: str):
        self.q: E = None
        self.x: E = None
        self.y: B = None
        self.w: B = None
        self.r: A = None
        self.txt = txt

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

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