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

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

class C:
    def __init__(self, txt: str):
        self.x: H = None
        self.txt = txt

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

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

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

class G:
    def __init__(self, txt: str):
        self.x: H = None
        self.z: F = None
        self.v: E = None
        self.r: H = None
        self.u: C = None
        self.w: B = None
        self.o: H = None
        self.t: E = None
        self.txt = txt

class H:
    def __init__(self, txt: str):
        self.q: D = None
        self.txt = txt

a = A("a")
j = B("j")
c = C("c")
g = D("g")
f = E("f")
i = F("i")
m = G("m")
d = H("d")
k = D("k")

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

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

class C:
    def __init__(self, txt: str):
        self.x: H = None
        self.txt = txt

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

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

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

class G:
    def __init__(self, txt: str):
        self.x: H = None
        self.z: F = None
        self.v: E = None
        self.r: H = None
        self.u: C = None
        self.w: B = None
        self.o: H = None
        self.t: E = None
        self.txt = txt

class H:
    def __init__(self, txt: str):
        self.q: D = None
        self.txt = txt

a = A("a")
j = B("j")
c = C("c")
g = D("g")
f = E("f")
i = F("i")
m = G("m")
d = H("d")
k = D("k")

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