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

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

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

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

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

class F:
    def __init__(self, txt: str):
        self.t: C = None
        self.q: E = None
        self.txt = txt

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

class H:
    def __init__(self, txt: str):
        self.t: C = None
        self.u: G = None
        self.o: G = None
        self.s: G = None
        self.y: C = None
        self.txt = txt

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

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

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

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

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

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

class F:
    def __init__(self, txt: str):
        self.t: C = None
        self.q: E = None
        self.txt = txt

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

class H:
    def __init__(self, txt: str):
        self.t: C = None
        self.u: G = None
        self.o: G = None
        self.s: G = None
        self.y: C = None
        self.txt = txt

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

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