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

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

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

class D:
    def __init__(self, txt: str):
        self.u: C = None
        self.txt = txt

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

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

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

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

g.t = m
h.t = g
f.p = n
i.u = f
j.y = l
j.z = g
j.w = g
j.t = i
j.s = i
j.u = b
l.s = g
l.x = f
l.u = c
l.t = c
l.p = n
l.o = b
m.s = f
m.x = n
m.p = i
m.o = g
m.u = b
n.s = g
n.x = f
n.u = h
n.t = h
n.p = l
n.o = b
b.y = n
b.z = g
b.w = g
b.t = i
b.s = i
b.u = j
c.t = g
assert l.x.p.x.p.o.y.s.t.txt == "
class A:
    def __init__(self, txt: str):
        self.t: G = None
        self.txt = txt

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

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

class D:
    def __init__(self, txt: str):
        self.u: C = None
        self.txt = txt

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

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

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

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

g.t = m
h.t = g
f.p = n
i.u = f
j.y = l
j.z = g
j.w = g
j.t = i
j.s = i
j.u = b
l.s = g
l.x = f
l.u = c
l.t = c
l.p = n
l.o = b
m.s = f
m.x = n
m.p = i
m.o = g
m.u = b
n.s = g
n.x = f
n.u = h
n.t = h
n.p = l
n.o = b
b.y = n
b.z = g
b.w = g
b.t = i
b.s = i
b.u = j
c.t = g
assert l.x.p.x.p.o.y.s.t.txt == "m"