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

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

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

class D:
    def __init__(self, txt: str):
        self.o: E = None
        self.p: D = None
        self.u: C = None
        self.q: F = None
        self.x: A = None
        self.z: B = None
        self.txt = txt

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

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

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

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

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

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

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

class D:
    def __init__(self, txt: str):
        self.o: E = None
        self.p: D = None
        self.u: C = None
        self.q: F = None
        self.x: A = None
        self.z: B = None
        self.txt = txt

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

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

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

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

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