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

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

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

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

class E:
    def __init__(self, txt: str):
        self.x: C = None
        self.z: G = None
        self.o: B = None
        self.u: B = None
        self.txt = txt

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

class G:
    def __init__(self, txt: str):
        self.r: F = None
        self.y: A = None
        self.o: C = None
        self.w: D = None
        self.u: D = None
        self.q: F = None
        self.v: C = None
        self.txt = txt

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

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

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

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

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

class E:
    def __init__(self, txt: str):
        self.x: C = None
        self.z: G = None
        self.o: B = None
        self.u: B = None
        self.txt = txt

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

class G:
    def __init__(self, txt: str):
        self.r: F = None
        self.y: A = None
        self.o: C = None
        self.w: D = None
        self.u: D = None
        self.q: F = None
        self.v: C = None
        self.txt = txt

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

j.t = h
j.s = h
e.s = m
k.w = c
k.z = j
m.o = h
m.y = f
m.z = k
m.w = k
c.x = g
c.z = f
c.o = e
c.u = e
h.t = f
h.x = c
f.r = h
f.q = h
f.y = j
f.o = k
f.w = m
f.u = m
f.v = g
g.w = c
g.z = j
assert g.w.o.s.y.y.t.txt == "h"