class A:
    def __init__(self, txt: str):
        self.v: C = None
        self.u: B = None
        self.t: C = None
        self.w: A = None
        self.y: D = None
        self.s: A = None
        self.txt = txt

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

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

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

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

class F:
    def __init__(self, txt: str):
        self.v: E = None
        self.r: A = None
        self.s: A = None
        self.txt = txt

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

j.v = n
j.t = n
j.u = c
j.w = b
j.s = b
j.y = a
c.v = i
c.q = b
n.y = f
n.w = f
n.z = c
a.z = c
f.z = i
i.v = f
i.r = b
i.s = b
b.v = n
b.t = n
b.u = c
b.w = j
b.s = j
b.y = a
assert b.u.v.v.z.txt == "
class A:
    def __init__(self, txt: str):
        self.v: C = None
        self.u: B = None
        self.t: C = None
        self.w: A = None
        self.y: D = None
        self.s: A = None
        self.txt = txt

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

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

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

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

class F:
    def __init__(self, txt: str):
        self.v: E = None
        self.r: A = None
        self.s: A = None
        self.txt = txt

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

j.v = n
j.t = n
j.u = c
j.w = b
j.s = b
j.y = a
c.v = i
c.q = b
n.y = f
n.w = f
n.z = c
a.z = c
f.z = i
i.v = f
i.r = b
i.s = b
b.v = n
b.t = n
b.u = c
b.w = j
b.s = j
b.y = a
assert b.u.v.v.z.txt == "i"