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

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

class C:
    def __init__(self, txt: str):
        self.u: D = None
        self.txt = txt

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

class E:
    def __init__(self, txt: str):
        self.y: C = None
        self.x: A = None
        self.s: C = None
        self.o: A = None
        self.z: E = None
        self.txt = txt

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

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

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

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

class C:
    def __init__(self, txt: str):
        self.u: D = None
        self.txt = txt

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

class E:
    def __init__(self, txt: str):
        self.y: C = None
        self.x: A = None
        self.s: C = None
        self.o: A = None
        self.z: E = None
        self.txt = txt

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

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

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