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

class B:
    def __init__(self, txt: str):
        self.z: E = None
        self.y: E = None
        self.u: A = None
        self.t: F = None
        self.w: E = None
        self.txt = txt

class C:
    def __init__(self, txt: str):
        self.z: G = None
        self.y: H = None
        self.txt = txt

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

class E:
    def __init__(self, txt: str):
        self.w: D = None
        self.o: C = None
        self.z: D = None
        self.v: D = None
        self.p: H = None
        self.x: F = None
        self.txt = txt

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

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

class H:
    def __init__(self, txt: str):
        self.x: G = None
        self.p: G = None
        self.w: C = None
        self.txt = txt

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

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

class B:
    def __init__(self, txt: str):
        self.z: E = None
        self.y: E = None
        self.u: A = None
        self.t: F = None
        self.w: E = None
        self.txt = txt

class C:
    def __init__(self, txt: str):
        self.z: G = None
        self.y: H = None
        self.txt = txt

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

class E:
    def __init__(self, txt: str):
        self.w: D = None
        self.o: C = None
        self.z: D = None
        self.v: D = None
        self.p: H = None
        self.x: F = None
        self.txt = txt

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

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

class H:
    def __init__(self, txt: str):
        self.x: G = None
        self.p: G = None
        self.w: C = None
        self.txt = txt

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

f.x = a
j.z = b
j.y = b
j.w = b
j.u = f
j.t = e
i.z = d
i.y = a
k.r = n
k.v = f
b.w = k
b.z = k
b.v = k
b.o = i
b.p = a
b.x = l
e.t = j
d.w = n
d.z = j
a.x = n
a.p = n
a.w = i
n.w = d
n.z = j
l.t = j
assert f.x.w.y.x.z.txt == "j"