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

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

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

class D:
    def __init__(self, txt: str):
        self.q: B = None
        self.p: C = None
        self.t: E = None
        self.r: C = None
        self.txt = txt

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

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

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

j.z = m
j.t = m
j.x = g
j.q = b
j.u = e
g.v = b
g.o = a
e.q = b
e.w = b
e.z = j
e.v = g
e.r = g
m.q = g
m.p = e
m.r = e
m.t = f
f.p = a
b.t = m
b.y = m
b.v = e
a.p = f
assert m.r.w.v.v.o.p.p.txt == "
class A:
    def __init__(self, txt: str):
        self.z: D = None
        self.x: B = None
        self.q: F = None
        self.t: D = None
        self.u: C = None
        self.txt = txt

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

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

class D:
    def __init__(self, txt: str):
        self.q: B = None
        self.p: C = None
        self.t: E = None
        self.r: C = None
        self.txt = txt

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

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

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

j.z = m
j.t = m
j.x = g
j.q = b
j.u = e
g.v = b
g.o = a
e.q = b
e.w = b
e.z = j
e.v = g
e.r = g
m.q = g
m.p = e
m.r = e
m.t = f
f.p = a
b.t = m
b.y = m
b.v = e
a.p = f
assert m.r.w.v.v.o.p.p.txt == "a"