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

class B:
    def __init__(self, txt: str):
        self.t: F = None
        self.q: D = None
        self.s: G = None
        self.y: A = None
        self.u: D = None
        self.txt = txt

class C:
    def __init__(self, txt: str):
        self.y: A = None
        self.s: B = 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.u: G = None
        self.w: C = None
        self.txt = txt

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

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

a = A("a")
e = B("e")
f = C("f")
k = D("k")
h = E("h")
g = F("g")
b = G("b")
j = G("j")
l = B("l")
n = D("n")

a.z = b
e.t = g
e.q = n
e.s = b
e.y = a
e.u = k
f.y = a
f.s = l
k.y = h
h.u = b
h.w = f
g.s = h
b.u = f
j.u = f
l.t = g
l.q = k
l.u = k
l.s = b
l.y = a
n.y = h
assert e.t.s.u.u.y.z.txt == "
class A:
    def __init__(self, txt: str):
        self.z: G = None
        self.txt = txt

class B:
    def __init__(self, txt: str):
        self.t: F = None
        self.q: D = None
        self.s: G = None
        self.y: A = None
        self.u: D = None
        self.txt = txt

class C:
    def __init__(self, txt: str):
        self.y: A = None
        self.s: B = 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.u: G = None
        self.w: C = None
        self.txt = txt

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

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

a = A("a")
e = B("e")
f = C("f")
k = D("k")
h = E("h")
g = F("g")
b = G("b")
j = G("j")
l = B("l")
n = D("n")

a.z = b
e.t = g
e.q = n
e.s = b
e.y = a
e.u = k
f.y = a
f.s = l
k.y = h
h.u = b
h.w = f
g.s = h
b.u = f
j.u = f
l.t = g
l.q = k
l.u = k
l.s = b
l.y = a
n.y = h
assert e.t.s.u.u.y.z.txt == "b"