class A:
    def __init__(self, txt: str):
        self.s: E = None
        self.x: D = None
        self.w: B = None
        self.o: E = None
        self.txt = txt

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

class C:
    def __init__(self, txt: str):
        self.s: A = None
        self.w: F = None
        self.y: E = None
        self.z: E = None
        self.o: A = None
        self.txt = txt

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

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

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

class G:
    def __init__(self, txt: str):
        self.p: E = None
        self.s: D = None
        self.v: A = None
        self.u: B = None
        self.x: B = None
        self.o: A = None
        self.r: A = None
        self.txt = txt

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

h.s = b
h.o = b
h.x = a
h.w = j
e.y = b
e.t = h
c.s = h
c.o = h
c.w = m
c.y = b
c.z = b
a.z = b
b.o = k
b.w = a
b.x = m
m.p = e
m.s = e
m.w = a
k.p = b
k.s = a
k.v = h
k.o = h
k.r = h
k.u = e
k.x = j
j.y = b
j.t = h
assert a.z.o.p.x.w.z.txt == "
class A:
    def __init__(self, txt: str):
        self.s: E = None
        self.x: D = None
        self.w: B = None
        self.o: E = None
        self.txt = txt

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

class C:
    def __init__(self, txt: str):
        self.s: A = None
        self.w: F = None
        self.y: E = None
        self.z: E = None
        self.o: A = None
        self.txt = txt

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

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

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

class G:
    def __init__(self, txt: str):
        self.p: E = None
        self.s: D = None
        self.v: A = None
        self.u: B = None
        self.x: B = None
        self.o: A = None
        self.r: A = None
        self.txt = txt

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

h.s = b
h.o = b
h.x = a
h.w = j
e.y = b
e.t = h
c.s = h
c.o = h
c.w = m
c.y = b
c.z = b
a.z = b
b.o = k
b.w = a
b.x = m
m.p = e
m.s = e
m.w = a
k.p = b
k.s = a
k.v = h
k.o = h
k.r = h
k.u = e
k.x = j
j.y = b
j.t = h
assert a.z.o.p.x.w.z.txt == "b"