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

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

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

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

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

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

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

n.r = f
n.p = f
n.v = l
n.x = l
a.z = l
k.o = g
k.v = a
k.t = l
l.t = k
l.u = k
l.r = f
l.v = a
l.x = m
l.q = m
f.y = g
f.p = h
g.u = c
g.w = h
h.r = f
h.p = f
h.v = l
h.x = l
m.z = l
c.u = g
c.w = n
d.r = f
d.p = f
d.v = l
d.x = l
assert a.z.u.o.txt == "
class A:
    def __init__(self, txt: str):
        self.r: E = None
        self.v: D = None
        self.x: D = None
        self.p: E = None
        self.txt = txt

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

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

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

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

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

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

n.r = f
n.p = f
n.v = l
n.x = l
a.z = l
k.o = g
k.v = a
k.t = l
l.t = k
l.u = k
l.r = f
l.v = a
l.x = m
l.q = m
f.y = g
f.p = h
g.u = c
g.w = h
h.r = f
h.p = f
h.v = l
h.x = l
m.z = l
c.u = g
c.w = n
d.r = f
d.p = f
d.v = l
d.x = l
assert a.z.u.o.txt == "g"