class A:
    def __init__(self, txt: str):
        self.p: E = None
        self.t: E = None
        self.w: E = None
        self.v: B = None
        self.txt = txt

class B:
    def __init__(self, txt: str):
        self.s: G = None
        self.z: E = None
        self.p: G = None
        self.txt = txt

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

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

class E:
    def __init__(self, txt: str):
        self.u: D = None
        self.w: G = None
        self.s: B = None
        self.x: D = None
        self.y: B = None
        self.txt = txt

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

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

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

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

class B:
    def __init__(self, txt: str):
        self.s: G = None
        self.z: E = None
        self.p: G = None
        self.txt = txt

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

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

class E:
    def __init__(self, txt: str):
        self.u: D = None
        self.w: G = None
        self.s: B = None
        self.x: D = None
        self.y: B = None
        self.txt = txt

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

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

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

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