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

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

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

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

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

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

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

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

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

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

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

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

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

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

h.y = b
b.v = h
k.p = c
k.x = c
k.v = h
k.w = b
k.s = n
k.q = j
c.p = h
c.x = h
c.u = k
c.w = n
n.u = h
n.x = k
j.t = n
j.u = n
j.z = n
j.q = c
j.p = h
assert h.y.v.y.v.y.txt == "b"