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

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

class C:
    def __init__(self, txt: str):
        self.t: A = None
        self.o: E = None
        self.u: F = None
        self.p: B = None
        self.z: E = None
        self.w: E = None
        self.txt = txt

class D:
    def __init__(self, txt: str):
        self.w: G = None
        self.txt = txt

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

class F:
    def __init__(self, txt: str):
        self.w: C = None
        self.s: G = None
        self.p: E = None
        self.r: C = None
        self.x: B = None
        self.txt = txt

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

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

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

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

class C:
    def __init__(self, txt: str):
        self.t: A = None
        self.o: E = None
        self.u: F = None
        self.p: B = None
        self.z: E = None
        self.w: E = None
        self.txt = txt

class D:
    def __init__(self, txt: str):
        self.w: G = None
        self.txt = txt

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

class F:
    def __init__(self, txt: str):
        self.w: C = None
        self.s: G = None
        self.p: E = None
        self.r: C = None
        self.x: B = None
        self.txt = txt

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

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

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