class A:
    def __init__(self, txt: str):
        self.w: G = None
        self.r: F = None
        self.z: C = None
        self.v: D = None
        self.q: B = None
        self.y: B = None
        self.u: F = None
        self.txt = txt

class B:
    def __init__(self, txt: str):
        self.r: A = None
        self.z: F = None
        self.txt = txt

class C:
    def __init__(self, txt: str):
        self.u: F = None
        self.x: G = None
        self.r: G = None
        self.s: E = None
        self.p: G = None
        self.txt = txt

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

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

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

class G:
    def __init__(self, txt: str):
        self.o: B = None
        self.y: D = None
        self.q: A = None
        self.p: B = None
        self.txt = txt

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

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

class B:
    def __init__(self, txt: str):
        self.r: A = None
        self.z: F = None
        self.txt = txt

class C:
    def __init__(self, txt: str):
        self.u: F = None
        self.x: G = None
        self.r: G = None
        self.s: E = None
        self.p: G = None
        self.txt = txt

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

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

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

class G:
    def __init__(self, txt: str):
        self.o: B = None
        self.y: D = None
        self.q: A = None
        self.p: B = None
        self.txt = txt

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

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