class A:
    def __init__(self, txt: str):
        self.w: H = None
        self.p: E = None
        self.q: D = None
        self.r: B = None
        self.t: D = None
        self.o: G = 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.r: G = None
        self.u: D = None
        self.o: F = None
        self.txt = txt

class D:
    def __init__(self, txt: str):
        self.s: H = None
        self.z: A = None
        self.v: G = None
        self.w: B = None
        self.p: G = None
        self.t: E = None
        self.u: G = None
        self.txt = txt

class E:
    def __init__(self, txt: str):
        self.w: C = None
        self.u: G = None
        self.p: F = None
        self.t: D = None
        self.r: B = None
        self.txt = txt

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

class G:
    def __init__(self, txt: str):
        self.p: B = None
        self.o: D = None
        self.t: F = None
        self.r: B = None
        self.txt = txt

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

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

f.w = k
f.p = e
f.q = i
f.t = i
f.r = c
f.o = j
c.x = e
n.r = j
n.u = i
n.o = l
i.s = k
i.z = f
i.v = j
i.p = j
i.u = j
i.w = c
i.t = e
e.w = n
e.u = j
e.p = l
e.t = i
e.r = c
l.t = f
l.r = c
l.u = e
l.o = e
l.y = k
j.p = c
j.r = c
j.o = i
j.t = l
k.s = f
assert f.q.w.x.p.t.txt == "
class A:
    def __init__(self, txt: str):
        self.w: H = None
        self.p: E = None
        self.q: D = None
        self.r: B = None
        self.t: D = None
        self.o: G = 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.r: G = None
        self.u: D = None
        self.o: F = None
        self.txt = txt

class D:
    def __init__(self, txt: str):
        self.s: H = None
        self.z: A = None
        self.v: G = None
        self.w: B = None
        self.p: G = None
        self.t: E = None
        self.u: G = None
        self.txt = txt

class E:
    def __init__(self, txt: str):
        self.w: C = None
        self.u: G = None
        self.p: F = None
        self.t: D = None
        self.r: B = None
        self.txt = txt

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

class G:
    def __init__(self, txt: str):
        self.p: B = None
        self.o: D = None
        self.t: F = None
        self.r: B = None
        self.txt = txt

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

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

f.w = k
f.p = e
f.q = i
f.t = i
f.r = c
f.o = j
c.x = e
n.r = j
n.u = i
n.o = l
i.s = k
i.z = f
i.v = j
i.p = j
i.u = j
i.w = c
i.t = e
e.w = n
e.u = j
e.p = l
e.t = i
e.r = c
l.t = f
l.r = c
l.u = e
l.o = e
l.y = k
j.p = c
j.r = c
j.o = i
j.t = l
k.s = f
assert f.q.w.x.p.t.txt == "f"