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

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

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

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

class E:
    def __init__(self, txt: str):
        self.q: F = None
        self.u: D = None
        self.r: F = None
        self.txt = txt

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

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

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

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

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

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

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

class E:
    def __init__(self, txt: str):
        self.q: F = None
        self.u: D = None
        self.r: F = None
        self.txt = txt

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

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

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

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