class A:
    def __init__(self, txt: str):
        self.p: H = None
        self.u: B = None
        self.s: H = None
        self.txt = txt

class B:
    def __init__(self, txt: str):
        self.q: E = None
        self.o: G = None
        self.y: G = None
        self.r: F = None
        self.p: A = None
        self.w: A = None
        self.txt = txt

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

class D:
    def __init__(self, txt: str):
        self.y: H = None
        self.o: A = None
        self.v: G = None
        self.z: F = None
        self.t: H = None
        self.u: B = None
        self.txt = txt

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

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

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

class H:
    def __init__(self, txt: str):
        self.v: E = None
        self.x: F = None
        self.z: D = None
        self.p: B = None
        self.y: E = None
        self.w: B = None
        self.txt = txt

l = A("l")
f = B("f")
e = C("e")
j = D("j")
a = E("a")
i = F("i")
m = G("m")
b = H("b")
g = B("g")

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

class B:
    def __init__(self, txt: str):
        self.q: E = None
        self.o: G = None
        self.y: G = None
        self.r: F = None
        self.p: A = None
        self.w: A = None
        self.txt = txt

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

class D:
    def __init__(self, txt: str):
        self.y: H = None
        self.o: A = None
        self.v: G = None
        self.z: F = None
        self.t: H = None
        self.u: B = None
        self.txt = txt

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

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

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

class H:
    def __init__(self, txt: str):
        self.v: E = None
        self.x: F = None
        self.z: D = None
        self.p: B = None
        self.y: E = None
        self.w: B = None
        self.txt = txt

l = A("l")
f = B("f")
e = C("e")
j = D("j")
a = E("a")
i = F("i")
m = G("m")
b = H("b")
g = B("g")

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