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

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

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

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

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

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

class G:
    def __init__(self, txt: str):
        self.x: C = None
        self.u: A = None
        self.txt = txt

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

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

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

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

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

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

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

class G:
    def __init__(self, txt: str):
        self.x: C = None
        self.u: A = None
        self.txt = txt

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

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