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

class B:
    def __init__(self, txt: str):
        self.s: C = None
        self.v: C = None
        self.q: E = None
        self.txt = txt

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

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

class E:
    def __init__(self, txt: str):
        self.s: A = None
        self.z: A = None
        self.t: A = None
        self.y: B = None
        self.txt = txt

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

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

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

g = A("g")
f = B("f")
b = C("b")
n = D("n")
k = E("k")
c = F("c")
l = G("l")
e = H("e")
a = F("a")

g.o = b
g.y = l
g.t = n
f.s = b
f.v = b
f.q = k
b.s = e
n.p = b
k.s = g
k.z = g
k.t = g
k.y = f
c.u = l
c.w = f
l.u = k
e.p = n
e.x = n
e.y = f
e.r = l
e.w = l
e.q = k
e.o = k
e.z = c
a.u = l
a.w = f
assert l.u.t.y.u.y.v.s.o.z.txt == "
class A:
    def __init__(self, txt: str):
        self.o: C = None
        self.y: G = None
        self.t: D = None
        self.txt = txt

class B:
    def __init__(self, txt: str):
        self.s: C = None
        self.v: C = None
        self.q: E = None
        self.txt = txt

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

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

class E:
    def __init__(self, txt: str):
        self.s: A = None
        self.z: A = None
        self.t: A = None
        self.y: B = None
        self.txt = txt

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

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

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

g = A("g")
f = B("f")
b = C("b")
n = D("n")
k = E("k")
c = F("c")
l = G("l")
e = H("e")
a = F("a")

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