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

class B:
    def __init__(self, txt: str):
        self.p: C = None
        self.s: F = None
        self.q: F = None
        self.z: D = None
        self.txt = txt

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

class D:
    def __init__(self, txt: str):
        self.u: C = None
        self.s: F = None
        self.x: F = None
        self.v: E = None
        self.txt = txt

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

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

class G:
    def __init__(self, txt: str):
        self.w: D = None
        self.txt = txt

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

j.t = c
j.v = k
n.p = c
n.s = d
n.q = d
n.z = a
c.w = a
c.x = m
c.z = l
c.v = f
c.s = f
c.o = d
a.u = c
a.s = d
a.x = d
a.v = f
f.u = d
d.p = l
d.x = f
d.w = j
d.v = m
d.u = k
d.y = a
l.w = a
k.p = c
k.s = d
k.q = d
k.z = a
m.p = c
m.s = d
m.q = d
m.z = a
assert f.u.x.u.x.u.w.v.txt == "
class A:
    def __init__(self, txt: str):
        self.t: C = None
        self.v: B = None
        self.txt = txt

class B:
    def __init__(self, txt: str):
        self.p: C = None
        self.s: F = None
        self.q: F = None
        self.z: D = None
        self.txt = txt

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

class D:
    def __init__(self, txt: str):
        self.u: C = None
        self.s: F = None
        self.x: F = None
        self.v: E = None
        self.txt = txt

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

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

class G:
    def __init__(self, txt: str):
        self.w: D = None
        self.txt = txt

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

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