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

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

class C:
    def __init__(self, txt: str):
        self.q: F = None
        self.p: C = None
        self.x: A = None
        self.t: E = None
        self.v: C = None
        self.txt = txt

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

class E:
    def __init__(self, txt: str):
        self.o: F = None
        self.z: F = None
        self.y: A = None
        self.t: B = None
        self.u: A = None
        self.q: A = None
        self.txt = txt

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

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

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

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

class C:
    def __init__(self, txt: str):
        self.q: F = None
        self.p: C = None
        self.x: A = None
        self.t: E = None
        self.v: C = None
        self.txt = txt

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

class E:
    def __init__(self, txt: str):
        self.o: F = None
        self.z: F = None
        self.y: A = None
        self.t: B = None
        self.u: A = None
        self.q: A = None
        self.txt = txt

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

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

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