class A:
    def __init__(self, txt: str):
        self.p: B = None
        self.t: A = None
        self.w: B = None
        self.r: D = None
        self.z: A = None
        self.q: A = None
        self.txt = txt

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

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

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

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

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

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

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

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

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

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

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

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

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

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