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

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

class C:
    def __init__(self, txt: str):
        self.q: E = None
        self.r: A = None
        self.x: D = None
        self.t: B = None
        self.w: A = None
        self.o: B = None
        self.txt = txt

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

class E:
    def __init__(self, txt: str):
        self.r: D = None
        self.u: F = None
        self.s: E = None
        self.y: E = None
        self.o: D = None
        self.x: F = None
        self.z: B = None
        self.txt = txt

class F:
    def __init__(self, txt: str):
        self.q: B = None
        self.v: G = None
        self.u: E = None
        self.p: E = None
        self.o: C = None
        self.r: A = None
        self.txt = txt

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

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

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

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

class C:
    def __init__(self, txt: str):
        self.q: E = None
        self.r: A = None
        self.x: D = None
        self.t: B = None
        self.w: A = None
        self.o: B = None
        self.txt = txt

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

class E:
    def __init__(self, txt: str):
        self.r: D = None
        self.u: F = None
        self.s: E = None
        self.y: E = None
        self.o: D = None
        self.x: F = None
        self.z: B = None
        self.txt = txt

class F:
    def __init__(self, txt: str):
        self.q: B = None
        self.v: G = None
        self.u: E = None
        self.p: E = None
        self.o: C = None
        self.r: A = None
        self.txt = txt

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

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

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