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

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

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

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

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

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

class G:
    def __init__(self, txt: str):
        self.r: C = None
        self.o: A = None
        self.w: F = None
        self.s: D = None
        self.txt = txt

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

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

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

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

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

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

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

class G:
    def __init__(self, txt: str):
        self.r: C = None
        self.o: A = None
        self.w: F = None
        self.s: D = None
        self.txt = txt

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

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