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

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

class C:
    def __init__(self, txt: str):
        self.u: G = None
        self.x: D = None
        self.y: B = None
        self.t: B = None
        self.s: B = None
        self.v: E = None
        self.txt = txt

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

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

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

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

c = A("c")
i = B("i")
l = C("l")
j = D("j")
b = E("b")
k = F("k")
e = G("e")
d = D("d")

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

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

class C:
    def __init__(self, txt: str):
        self.u: G = None
        self.x: D = None
        self.y: B = None
        self.t: B = None
        self.s: B = None
        self.v: E = None
        self.txt = txt

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

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

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

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

c = A("c")
i = B("i")
l = C("l")
j = D("j")
b = E("b")
k = F("k")
e = G("e")
d = D("d")

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