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

class B:
    def __init__(self, txt: str):
        self.s: C = None
        self.r: G = None
        self.y: C = None
        self.z: F = None
        self.u: C = None
        self.x: D = None
        self.txt = txt

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

class D:
    def __init__(self, txt: str):
        self.u: F = None
        self.v: E = None
        self.txt = txt

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

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

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

f = A("f")
g = B("g")
c = C("c")
b = D("b")
a = E("a")
m = F("m")
l = G("l")

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

class B:
    def __init__(self, txt: str):
        self.s: C = None
        self.r: G = None
        self.y: C = None
        self.z: F = None
        self.u: C = None
        self.x: D = None
        self.txt = txt

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

class D:
    def __init__(self, txt: str):
        self.u: F = None
        self.v: E = None
        self.txt = txt

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

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

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

f = A("f")
g = B("g")
c = C("c")
b = D("b")
a = E("a")
m = F("m")
l = G("l")

f.t = a
f.v = l
g.s = c
g.y = c
g.u = c
g.r = l
g.z = m
g.x = b
c.w = g
c.p = f
c.s = m
b.u = m
b.v = a
a.p = c
a.u = b
a.q = l
a.y = g
m.y = l
l.v = c
l.y = g
l.z = m
l.s = m
l.q = a
l.p = b
assert m.y.y.z.y.y.txt == "g"