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

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

class C:
    def __init__(self, txt: str):
        self.t: H = None
        self.q: A = None
        self.p: H = None
        self.txt = txt

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

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

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

class G:
    def __init__(self, txt: str):
        self.o: E = None
        self.txt = txt

class H:
    def __init__(self, txt: str):
        self.z: B = None
        self.w: F = None
        self.o: A = None
        self.v: C = None
        self.x: C = None
        self.y: F = None
        self.p: E = None
        self.r: G = None
        self.txt = txt

e = A("e")
f = B("f")
d = C("d")
b = D("b")
j = E("j")
m = F("m")
c = G("c")
n = H("n")
h = C("h")
g = F("g")

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

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

class C:
    def __init__(self, txt: str):
        self.t: H = None
        self.q: A = None
        self.p: H = None
        self.txt = txt

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

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

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

class G:
    def __init__(self, txt: str):
        self.o: E = None
        self.txt = txt

class H:
    def __init__(self, txt: str):
        self.z: B = None
        self.w: F = None
        self.o: A = None
        self.v: C = None
        self.x: C = None
        self.y: F = None
        self.p: E = None
        self.r: G = None
        self.txt = txt

e = A("e")
f = B("f")
d = C("d")
b = D("b")
j = E("j")
m = F("m")
c = G("c")
n = H("n")
h = C("h")
g = F("g")

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