class A:
    def __init__(self, txt: str):
        self.p: D = None
        self.q: H = None
        self.s: F = None
        self.v: F = None
        self.z: C = None
        self.r: H = None
        self.txt = txt

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

class C:
    def __init__(self, txt: str):
        self.o: A = None
        self.p: D = None
        self.r: B = None
        self.txt = txt

class D:
    def __init__(self, txt: str):
        self.p: B = None
        self.u: B = None
        self.s: A = None
        self.w: G = None
        self.y: B = None
        self.r: H = None
        self.v: G = None
        self.txt = txt

class E:
    def __init__(self, txt: str):
        self.r: H = None
        self.p: F = None
        self.q: H = None
        self.s: H = None
        self.u: E = None
        self.o: F = None
        self.v: G = None
        self.txt = txt

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

class G:
    def __init__(self, txt: str):
        self.u: H = None
        self.txt = txt

class H:
    def __init__(self, txt: str):
        self.u: A = None
        self.z: C = None
        self.w: E = None
        self.s: E = None
        self.txt = txt

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

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

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

class C:
    def __init__(self, txt: str):
        self.o: A = None
        self.p: D = None
        self.r: B = None
        self.txt = txt

class D:
    def __init__(self, txt: str):
        self.p: B = None
        self.u: B = None
        self.s: A = None
        self.w: G = None
        self.y: B = None
        self.r: H = None
        self.v: G = None
        self.txt = txt

class E:
    def __init__(self, txt: str):
        self.r: H = None
        self.p: F = None
        self.q: H = None
        self.s: H = None
        self.u: E = None
        self.o: F = None
        self.v: G = None
        self.txt = txt

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

class G:
    def __init__(self, txt: str):
        self.u: H = None
        self.txt = txt

class H:
    def __init__(self, txt: str):
        self.u: A = None
        self.z: C = None
        self.w: E = None
        self.s: E = None
        self.txt = txt

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

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