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

class B:
    def __init__(self, txt: str):
        self.q: H = None
        self.u: H = None
        self.v: F = None
        self.txt = txt

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

class D:
    def __init__(self, txt: str):
        self.y: A = None
        self.p: E = None
        self.q: A = None
        self.s: F = None
        self.txt = txt

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

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

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

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

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

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

class B:
    def __init__(self, txt: str):
        self.q: H = None
        self.u: H = None
        self.v: F = None
        self.txt = txt

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

class D:
    def __init__(self, txt: str):
        self.y: A = None
        self.p: E = None
        self.q: A = None
        self.s: F = None
        self.txt = txt

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

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

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

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

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

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