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

class B:
    def __init__(self, txt: str):
        self.x: E = None
        self.txt = txt

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

class D:
    def __init__(self, txt: str):
        self.r: C = None
        self.y: H = None
        self.o: H = None
        self.q: H = None
        self.txt = txt

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

class F:
    def __init__(self, txt: str):
        self.x: B = None
        self.w: G = None
        self.v: B = None
        self.txt = txt

class G:
    def __init__(self, txt: str):
        self.r: F = None
        self.s: A = None
        self.q: E = None
        self.v: H = None
        self.txt = txt

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

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

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

class B:
    def __init__(self, txt: str):
        self.x: E = None
        self.txt = txt

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

class D:
    def __init__(self, txt: str):
        self.r: C = None
        self.y: H = None
        self.o: H = None
        self.q: H = None
        self.txt = txt

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

class F:
    def __init__(self, txt: str):
        self.x: B = None
        self.w: G = None
        self.v: B = None
        self.txt = txt

class G:
    def __init__(self, txt: str):
        self.r: F = None
        self.s: A = None
        self.q: E = None
        self.v: H = None
        self.txt = txt

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

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

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