class A:
    def __init__(self, txt: str):
        self.p: F = None
        self.s: D = None
        self.txt = txt

class B:
    def __init__(self, txt: str):
        self.w: G = None
        self.q: H = None
        self.r: A = None
        self.u: F = None
        self.txt = txt

class C:
    def __init__(self, txt: str):
        self.u: D = None
        self.y: E = None
        self.txt = txt

class D:
    def __init__(self, txt: str):
        self.q: C = None
        self.s: C = None
        self.y: B = None
        self.txt = txt

class E:
    def __init__(self, txt: str):
        self.r: D = None
        self.txt = txt

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

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

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

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

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

class B:
    def __init__(self, txt: str):
        self.w: G = None
        self.q: H = None
        self.r: A = None
        self.u: F = None
        self.txt = txt

class C:
    def __init__(self, txt: str):
        self.u: D = None
        self.y: E = None
        self.txt = txt

class D:
    def __init__(self, txt: str):
        self.q: C = None
        self.s: C = None
        self.y: B = None
        self.txt = txt

class E:
    def __init__(self, txt: str):
        self.r: D = None
        self.txt = txt

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

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

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

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

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