class A:
    def __init__(self, txt: str):
        self.r: C = None
        self.t: G = None
        self.p: C = None
        self.txt = txt

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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