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

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

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

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

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

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

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

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

j.z = f
f.u = e
f.t = b
b.s = c
g.q = f
g.u = m
g.t = m
g.x = c
g.o = c
g.w = c
g.y = e
c.y = j
c.x = m
e.x = g
m.o = c
m.q = b
n.x = g
assert g.y.x.q.t.s.txt == "
class A:
    def __init__(self, txt: str):
        self.z: B = None
        self.txt = txt

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

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

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

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

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

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

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

j.z = f
f.u = e
f.t = b
b.s = c
g.q = f
g.u = m
g.t = m
g.x = c
g.o = c
g.w = c
g.y = e
c.y = j
c.x = m
e.x = g
m.o = c
m.q = b
n.x = g
assert g.y.x.q.t.s.txt == "c"