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

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

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

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

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

class F:
    def __init__(self, txt: str):
        self.y: D = None
        self.o: G = None
        self.u: B = None
        self.q: A = None
        self.z: A = None
        self.txt = txt

class G:
    def __init__(self, txt: str):
        self.z: F = None
        self.x: B = None
        self.y: H = None
        self.u: H = None
        self.r: F = None
        self.q: B = None
        self.p: F = None
        self.txt = txt

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

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

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

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

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

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

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

class F:
    def __init__(self, txt: str):
        self.y: D = None
        self.o: G = None
        self.u: B = None
        self.q: A = None
        self.z: A = None
        self.txt = txt

class G:
    def __init__(self, txt: str):
        self.z: F = None
        self.x: B = None
        self.y: H = None
        self.u: H = None
        self.r: F = None
        self.q: B = None
        self.p: F = None
        self.txt = txt

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

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

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