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

class B:
    def __init__(self, txt: str):
        self.r: C = None
        self.p: A = None
        self.s: C = None
        self.o: F = None
        self.u: F = None
        self.txt = txt

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

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

class E:
    def __init__(self, txt: str):
        self.x: F = None
        self.q: A = None
        self.w: F = None
        self.u: B = None
        self.txt = txt

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

class G:
    def __init__(self, txt: str):
        self.x: F = None
        self.txt = txt

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

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

class B:
    def __init__(self, txt: str):
        self.r: C = None
        self.p: A = None
        self.s: C = None
        self.o: F = None
        self.u: F = None
        self.txt = txt

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

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

class E:
    def __init__(self, txt: str):
        self.x: F = None
        self.q: A = None
        self.w: F = None
        self.u: B = None
        self.txt = txt

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

class G:
    def __init__(self, txt: str):
        self.x: F = None
        self.txt = txt

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

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