class A:
    def __init__(self, txt: str):
        self.u: G = None
        self.p: C = None
        self.txt = txt

class B:
    def __init__(self, txt: str):
        self.p: G = None
        self.txt = txt

class C:
    def __init__(self, txt: str):
        self.p: H = None
        self.s: B = None
        self.w: E = None
        self.txt = txt

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

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

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

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

class H:
    def __init__(self, txt: str):
        self.x: C = None
        self.t: B = None
        self.txt = txt

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

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

class B:
    def __init__(self, txt: str):
        self.p: G = None
        self.txt = txt

class C:
    def __init__(self, txt: str):
        self.p: H = None
        self.s: B = None
        self.w: E = None
        self.txt = txt

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

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

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

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

class H:
    def __init__(self, txt: str):
        self.x: C = None
        self.t: B = None
        self.txt = txt

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

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