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

class B:
    def __init__(self, txt: str):
        self.x: A = None
        self.y: A = None
        self.t: E = None
        self.r: G = None
        self.p: C = None
        self.txt = txt

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

class D:
    def __init__(self, txt: str):
        self.x: F = None
        self.txt = txt

class E:
    def __init__(self, txt: str):
        self.v: F = None
        self.u: C = None
        self.o: B = None
        self.q: F = None
        self.s: A = None
        self.y: G = None
        self.txt = txt

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

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

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

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

class B:
    def __init__(self, txt: str):
        self.x: A = None
        self.y: A = None
        self.t: E = None
        self.r: G = None
        self.p: C = None
        self.txt = txt

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

class D:
    def __init__(self, txt: str):
        self.x: F = None
        self.txt = txt

class E:
    def __init__(self, txt: str):
        self.v: F = None
        self.u: C = None
        self.o: B = None
        self.q: F = None
        self.s: A = None
        self.y: G = None
        self.txt = txt

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

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

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

a.w = l
g.x = a
g.y = a
g.t = d
g.r = n
g.p = b
h.u = d
h.o = d
h.x = d
h.z = a
h.s = j
h.p = l
h.t = g
j.x = k
d.v = k
d.q = k
d.u = h
d.o = g
d.s = a
d.y = f
k.t = l
k.o = f
k.y = g
k.z = h
n.v = h
n.z = f
n.t = d
f.v = b
f.z = n
f.t = d
l.w = a
b.u = d
b.o = d
b.x = d
b.z = l
b.s = j
b.p = a
b.t = g
assert f.z.v.o.s.w.w.w.txt == "l"