class A:
    def __init__(self, txt: str):
        self.t: D = None
        self.o: B = None
        self.x: G = None
        self.r: C = None
        self.txt = txt

class B:
    def __init__(self, txt: str):
        self.s: C = None
        self.y: G = None
        self.q: E = None
        self.t: D = None
        self.p: G = None
        self.txt = txt

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

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

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

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

class G:
    def __init__(self, txt: str):
        self.v: D = None
        self.s: A = None
        self.r: C = None
        self.u: D = None
        self.w: E = None
        self.txt = txt

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

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

class B:
    def __init__(self, txt: str):
        self.s: C = None
        self.y: G = None
        self.q: E = None
        self.t: D = None
        self.p: G = None
        self.txt = txt

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

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

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

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

class G:
    def __init__(self, txt: str):
        self.v: D = None
        self.s: A = None
        self.r: C = None
        self.u: D = None
        self.w: E = None
        self.txt = txt

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

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