class A:
    def __init__(self, txt: str):
        self.v: D = None
        self.o: A = None
        self.q: B = None
        self.txt = txt

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

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

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

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

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

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

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

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

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

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

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

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

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

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