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

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

class C:
    def __init__(self, txt: str):
        self.y: G = None
        self.s: B = None
        self.p: E = None
        self.x: B = None
        self.txt = txt

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

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

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

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

class H:
    def __init__(self, txt: str):
        self.q: A = None
        self.o: E = None
        self.txt = txt

i = A("i")
h = B("h")
f = C("f")
g = D("g")
b = E("b")
n = F("n")
l = G("l")
j = H("j")
k = C("k")
m = F("m")

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

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

class C:
    def __init__(self, txt: str):
        self.y: G = None
        self.s: B = None
        self.p: E = None
        self.x: B = None
        self.txt = txt

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

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

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

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

class H:
    def __init__(self, txt: str):
        self.q: A = None
        self.o: E = None
        self.txt = txt

i = A("i")
h = B("h")
f = C("f")
g = D("g")
b = E("b")
n = F("n")
l = G("l")
j = H("j")
k = C("k")
m = F("m")

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