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

class B:
    def __init__(self, txt: str):
        self.s: C = None
        self.z: C = None
        self.y: D = None
        self.v: E = None
        self.w: C = None
        self.q: A = None
        self.o: C = None
        self.txt = txt

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

class D:
    def __init__(self, txt: str):
        self.q: E = None
        self.x: G = None
        self.txt = txt

class E:
    def __init__(self, txt: str):
        self.s: F = None
        self.z: C = None
        self.txt = txt

class F:
    def __init__(self, txt: str):
        self.q: E = None
        self.y: B = None
        self.v: D = None
        self.t: D = None
        self.r: B = None
        self.s: D = None
        self.txt = txt

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

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

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

class B:
    def __init__(self, txt: str):
        self.s: C = None
        self.z: C = None
        self.y: D = None
        self.v: E = None
        self.w: C = None
        self.q: A = None
        self.o: C = None
        self.txt = txt

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

class D:
    def __init__(self, txt: str):
        self.q: E = None
        self.x: G = None
        self.txt = txt

class E:
    def __init__(self, txt: str):
        self.s: F = None
        self.z: C = None
        self.txt = txt

class F:
    def __init__(self, txt: str):
        self.q: E = None
        self.y: B = None
        self.v: D = None
        self.t: D = None
        self.r: B = None
        self.s: D = None
        self.txt = txt

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

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

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