class A:
    def __init__(self, txt: str):
        self.o: C = None
        self.txt = txt

class B:
    def __init__(self, txt: str):
        self.s: C = None
        self.u: E = None
        self.txt = txt

class C:
    def __init__(self, txt: str):
        self.y: G = None
        self.z: D = None
        self.t: D = None
        self.txt = txt

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

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

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

class G:
    def __init__(self, txt: str):
        self.u: B = None
        self.w: C = None
        self.q: B = None
        self.p: F = None
        self.txt = txt

g = A("g")
n = B("n")
b = C("b")
c = D("c")
a = E("a")
j = F("j")
m = G("m")
l = D("l")

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

class B:
    def __init__(self, txt: str):
        self.s: C = None
        self.u: E = None
        self.txt = txt

class C:
    def __init__(self, txt: str):
        self.y: G = None
        self.z: D = None
        self.t: D = None
        self.txt = txt

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

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

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

class G:
    def __init__(self, txt: str):
        self.u: B = None
        self.w: C = None
        self.q: B = None
        self.p: F = None
        self.txt = txt

g = A("g")
n = B("n")
b = C("b")
c = D("c")
a = E("a")
j = F("j")
m = G("m")
l = D("l")

g.o = b
n.s = b
n.u = a
b.y = m
b.z = l
b.t = c
c.r = j
c.z = m
c.u = a
a.x = j
j.z = m
j.x = g
j.u = n
j.q = n
m.u = n
m.q = n
m.w = b
m.p = j
l.r = j
l.z = m
l.u = a
assert c.u.x.x.o.t.r.txt == "j"