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

class B:
    def __init__(self, txt: str):
        self.r: C = None
        self.w: E = None
        self.u: C = None
        self.v: C = None
        self.txt = txt

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

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

class E:
    def __init__(self, txt: str):
        self.w: F = None
        self.t: G = None
        self.p: G = None
        self.v: G = None
        self.o: B = None
        self.txt = txt

class F:
    def __init__(self, txt: str):
        self.x: G = None
        self.p: E = None
        self.y: G = None
        self.w: G = None
        self.r: D = None
        self.txt = txt

class G:
    def __init__(self, txt: str):
        self.q: F = None
        self.r: D = None
        self.x: B = None
        self.y: C = None
        self.o: C = None
        self.txt = txt

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

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

class B:
    def __init__(self, txt: str):
        self.r: C = None
        self.w: E = None
        self.u: C = None
        self.v: C = None
        self.txt = txt

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

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

class E:
    def __init__(self, txt: str):
        self.w: F = None
        self.t: G = None
        self.p: G = None
        self.v: G = None
        self.o: B = None
        self.txt = txt

class F:
    def __init__(self, txt: str):
        self.x: G = None
        self.p: E = None
        self.y: G = None
        self.w: G = None
        self.r: D = None
        self.txt = txt

class G:
    def __init__(self, txt: str):
        self.q: F = None
        self.r: D = None
        self.x: B = None
        self.y: C = None
        self.o: C = None
        self.txt = txt

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

a.w = k
a.r = n
j.r = b
j.u = b
j.v = b
j.w = k
b.q = c
b.u = j
b.v = k
b.y = a
i.y = k
k.w = d
k.t = c
k.p = c
k.v = c
k.o = j
d.x = c
d.y = c
d.w = c
d.p = k
d.r = m
c.q = d
c.r = m
c.x = j
c.y = b
c.o = b
m.y = k
n.w = k
n.r = a
assert c.r.y.w.txt == "d"