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

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

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

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

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

class F:
    def __init__(self, txt: str):
        self.t: B = None
        self.v: D = None
        self.w: D = None
        self.y: G = None
        self.x: G = None
        self.txt = txt

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

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

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

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

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

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

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

class F:
    def __init__(self, txt: str):
        self.t: B = None
        self.v: D = None
        self.w: D = None
        self.y: G = None
        self.x: G = None
        self.txt = txt

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

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

l.r = h
l.q = h
l.t = d
l.p = i
l.u = n
h.r = i
h.t = k
h.u = c
h.x = d
h.o = m
h.s = m
c.y = n
c.t = n
c.p = k
c.v = k
c.r = i
c.w = m
i.o = d
i.y = d
d.v = c
d.o = n
k.t = h
k.v = i
k.w = i
k.y = n
k.x = n
n.r = c
n.u = k
m.r = i
m.t = k
m.u = c
m.x = d
m.o = h
m.s = h
assert n.r.w.x.v.txt == "c"