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

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

class C:
    def __init__(self, txt: str):
        self.u: F = None
        self.o: B = None
        self.r: E = None
        self.s: A = None
        self.txt = txt

class D:
    def __init__(self, txt: str):
        self.p: E = None
        self.x: A = None
        self.z: F = None
        self.txt = txt

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

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

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

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

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

class C:
    def __init__(self, txt: str):
        self.u: F = None
        self.o: B = None
        self.r: E = None
        self.s: A = None
        self.txt = txt

class D:
    def __init__(self, txt: str):
        self.p: E = None
        self.x: A = None
        self.z: F = None
        self.txt = txt

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

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

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

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