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

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

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

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

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

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

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

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

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

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

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

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

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

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

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