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

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

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

class D:
    def __init__(self, txt: str):
        self.u: G = None
        self.w: E = None
        self.o: G = None
        self.r: F = None
        self.s: E = None
        self.x: A = None
        self.v: A = None
        self.txt = txt

class E:
    def __init__(self, txt: str):
        self.z: G = None
        self.q: F = None
        self.p: B = None
        self.x: G = None
        self.u: G = None
        self.r: A = None
        self.txt = txt

class F:
    def __init__(self, txt: str):
        self.x: D = None
        self.p: C = None
        self.q: B = None
        self.u: C = None
        self.txt = txt

class G:
    def __init__(self, txt: str):
        self.r: D = None
        self.w: B = None
        self.txt = txt

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

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

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

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

class D:
    def __init__(self, txt: str):
        self.u: G = None
        self.w: E = None
        self.o: G = None
        self.r: F = None
        self.s: E = None
        self.x: A = None
        self.v: A = None
        self.txt = txt

class E:
    def __init__(self, txt: str):
        self.z: G = None
        self.q: F = None
        self.p: B = None
        self.x: G = None
        self.u: G = None
        self.r: A = None
        self.txt = txt

class F:
    def __init__(self, txt: str):
        self.x: D = None
        self.p: C = None
        self.q: B = None
        self.u: C = None
        self.txt = txt

class G:
    def __init__(self, txt: str):
        self.r: D = None
        self.w: B = None
        self.txt = txt

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

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