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

class B:
    def __init__(self, txt: str):
        self.r: C = None
        self.x: A = None
        self.o: D = None
        self.t: B = None
        self.txt = txt

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

class D:
    def __init__(self, txt: str):
        self.t: B = None
        self.s: C = None
        self.q: E = None
        self.u: A = None
        self.z: B = None
        self.txt = txt

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

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

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

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

class B:
    def __init__(self, txt: str):
        self.r: C = None
        self.x: A = None
        self.o: D = None
        self.t: B = None
        self.txt = txt

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

class D:
    def __init__(self, txt: str):
        self.t: B = None
        self.s: C = None
        self.q: E = None
        self.u: A = None
        self.z: B = None
        self.txt = txt

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

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

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

n.q = f
f.r = g
f.x = n
f.o = j
f.t = h
g.u = h
g.y = f
g.p = m
g.o = k
g.r = b
j.t = f
j.s = m
j.q = c
j.u = n
j.z = h
c.u = n
c.z = f
k.o = n
k.v = c
k.x = b
b.o = n
b.v = c
b.x = d
m.u = h
m.y = h
m.p = g
m.o = b
m.r = k
h.r = g
h.x = n
h.o = j
h.t = f
d.o = n
d.v = c
d.x = k
assert d.v.z.o.u.txt == "n"