class A:
    def __init__(self, txt: str):
        self.q: C = None
        self.y: C = None
        self.o: D = None
        self.txt = txt

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

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

class D:
    def __init__(self, txt: str):
        self.p: C = None
        self.t: E = None
        self.y: A = None
        self.z: A = None
        self.txt = txt

class E:
    def __init__(self, txt: str):
        self.q: C = None
        self.txt = txt

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

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

b.q = c
b.y = c
b.o = e
f.v = c
f.r = e
f.z = n
c.w = i
c.r = i
c.q = e
c.y = f
e.p = c
e.t = k
e.y = b
e.z = b
k.q = c
i.y = e
i.r = c
i.t = b
n.v = c
n.r = e
n.z = f
assert c.y.v.q.t.q.txt == "
class A:
    def __init__(self, txt: str):
        self.q: C = None
        self.y: C = None
        self.o: D = None
        self.txt = txt

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

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

class D:
    def __init__(self, txt: str):
        self.p: C = None
        self.t: E = None
        self.y: A = None
        self.z: A = None
        self.txt = txt

class E:
    def __init__(self, txt: str):
        self.q: C = None
        self.txt = txt

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

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

b.q = c
b.y = c
b.o = e
f.v = c
f.r = e
f.z = n
c.w = i
c.r = i
c.q = e
c.y = f
e.p = c
e.t = k
e.y = b
e.z = b
k.q = c
i.y = e
i.r = c
i.t = b
n.v = c
n.r = e
n.z = f
assert c.y.v.q.t.q.txt == "c"