class A:
    def __init__(self, txt: str):
        self.s: C = None
        self.w: C = None
        self.txt = txt

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

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

class D:
    def __init__(self, txt: str):
        self.q: F = None
        self.v: C = None
        self.y: E = None
        self.t: C = None
        self.txt = txt

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

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

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

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

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

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

class D:
    def __init__(self, txt: str):
        self.q: F = None
        self.v: C = None
        self.y: E = None
        self.t: C = None
        self.txt = txt

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

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

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

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