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

class B:
    def __init__(self, txt: str):
        self.u: A = None
        self.y: D = None
        self.p: F = None
        self.o: D = None
        self.w: A = None
        self.txt = txt

class C:
    def __init__(self, txt: str):
        self.q: A = None
        self.y: A = None
        self.z: F = None
        self.v: D = None
        self.p: G = None
        self.o: C = None
        self.t: A = None
        self.txt = txt

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

class E:
    def __init__(self, txt: str):
        self.w: C = None
        self.y: E = None
        self.p: B = None
        self.z: G = None
        self.s: C = None
        self.u: A = None
        self.q: G = None
        self.txt = txt

class F:
    def __init__(self, txt: str):
        self.s: C = None
        self.txt = txt

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

f = A("f")
j = B("j")
l = C("l")
m = D("m")
g = E("g")
n = F("n")
c = G("c")
h = C("h")
a = E("a")
b = D("b")

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

class B:
    def __init__(self, txt: str):
        self.u: A = None
        self.y: D = None
        self.p: F = None
        self.o: D = None
        self.w: A = None
        self.txt = txt

class C:
    def __init__(self, txt: str):
        self.q: A = None
        self.y: A = None
        self.z: F = None
        self.v: D = None
        self.p: G = None
        self.o: C = None
        self.t: A = None
        self.txt = txt

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

class E:
    def __init__(self, txt: str):
        self.w: C = None
        self.y: E = None
        self.p: B = None
        self.z: G = None
        self.s: C = None
        self.u: A = None
        self.q: G = None
        self.txt = txt

class F:
    def __init__(self, txt: str):
        self.s: C = None
        self.txt = txt

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

f = A("f")
j = B("j")
l = C("l")
m = D("m")
g = E("g")
n = F("n")
c = G("c")
h = C("h")
a = E("a")
b = D("b")

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