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

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

class C:
    def __init__(self, txt: str):
        self.v: E = None
        self.w: B = None
        self.y: F = None
        self.p: D = None
        self.z: A = None
        self.txt = txt

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

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

class F:
    def __init__(self, txt: str):
        self.r: A = None
        self.z: C = None
        self.o: C = None
        self.t: E = None
        self.txt = txt

class G:
    def __init__(self, txt: str):
        self.s: D = None
        self.z: A = None
        self.t: B = None
        self.o: F = None
        self.v: B = None
        self.txt = txt

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

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

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

class C:
    def __init__(self, txt: str):
        self.v: E = None
        self.w: B = None
        self.y: F = None
        self.p: D = None
        self.z: A = None
        self.txt = txt

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

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

class F:
    def __init__(self, txt: str):
        self.r: A = None
        self.z: C = None
        self.o: C = None
        self.t: E = None
        self.txt = txt

class G:
    def __init__(self, txt: str):
        self.s: D = None
        self.z: A = None
        self.t: B = None
        self.o: F = None
        self.v: B = None
        self.txt = txt

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

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