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

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

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

class D:
    def __init__(self, txt: str):
        self.y: B = None
        self.u: E = None
        self.x: C = None
        self.p: B = None
        self.z: G = None
        self.q: C = None
        self.w: G = None
        self.txt = txt

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

class F:
    def __init__(self, txt: str):
        self.y: B = None
        self.q: G = None
        self.s: B = None
        self.x: G = None
        self.z: B = None
        self.w: G = None
        self.txt = txt

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

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

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

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

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

class D:
    def __init__(self, txt: str):
        self.y: B = None
        self.u: E = None
        self.x: C = None
        self.p: B = None
        self.z: G = None
        self.q: C = None
        self.w: G = None
        self.txt = txt

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

class F:
    def __init__(self, txt: str):
        self.y: B = None
        self.q: G = None
        self.s: B = None
        self.x: G = None
        self.z: B = None
        self.w: G = None
        self.txt = txt

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

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

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