class A:
    def __init__(self, txt: str):
        self.x: C = None
        self.r: C = None
        self.z: F = None
        self.o: E = None
        self.q: F = None
        self.txt = txt

class B:
    def __init__(self, txt: str):
        self.u: E = None
        self.r: B = None
        self.v: F = None
        self.w: B = None
        self.t: A = None
        self.txt = txt

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

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

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

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

m = A("m")
f = B("f")
n = C("n")
c = D("c")
d = E("d")
e = F("e")
g = B("g")
k = F("k")

m.x = n
m.r = n
m.z = k
m.q = k
m.o = d
f.u = d
f.r = g
f.w = g
f.v = k
f.t = m
n.y = f
n.s = e
n.v = e
n.x = d
n.o = d
c.t = e
c.x = e
c.s = m
c.w = n
d.t = c
d.v = c
d.z = c
d.r = g
d.s = k
d.w = k
e.q = d
e.s = n
g.u = d
g.r = f
g.w = f
g.v = k
g.t = m
k.q = d
k.s = n
assert n.y.v.q.r.t.q.txt == "
class A:
    def __init__(self, txt: str):
        self.x: C = None
        self.r: C = None
        self.z: F = None
        self.o: E = None
        self.q: F = None
        self.txt = txt

class B:
    def __init__(self, txt: str):
        self.u: E = None
        self.r: B = None
        self.v: F = None
        self.w: B = None
        self.t: A = None
        self.txt = txt

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

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

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

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

m = A("m")
f = B("f")
n = C("n")
c = D("c")
d = E("d")
e = F("e")
g = B("g")
k = F("k")

m.x = n
m.r = n
m.z = k
m.q = k
m.o = d
f.u = d
f.r = g
f.w = g
f.v = k
f.t = m
n.y = f
n.s = e
n.v = e
n.x = d
n.o = d
c.t = e
c.x = e
c.s = m
c.w = n
d.t = c
d.v = c
d.z = c
d.r = g
d.s = k
d.w = k
e.q = d
e.s = n
g.u = d
g.r = f
g.w = f
g.v = k
g.t = m
k.q = d
k.s = n
assert n.y.v.q.r.t.q.txt == "k"