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

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

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

class D:
    def __init__(self, txt: str):
        self.w: F = None
        self.x: B = None
        self.txt = txt

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

class F:
    def __init__(self, txt: str):
        self.p: G = None
        self.v: A = None
        self.z: C = None
        self.txt = txt

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

m = A("m")
g = B("g")
e = C("e")
f = D("f")
j = E("j")
h = F("h")
l = G("l")

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

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

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

class D:
    def __init__(self, txt: str):
        self.w: F = None
        self.x: B = None
        self.txt = txt

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

class F:
    def __init__(self, txt: str):
        self.p: G = None
        self.v: A = None
        self.z: C = None
        self.txt = txt

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

m = A("m")
g = B("g")
e = C("e")
f = D("f")
j = E("j")
h = F("h")
l = G("l")

m.v = e
g.w = h
g.q = h
g.p = h
g.u = h
g.y = l
g.o = e
e.y = l
e.r = l
e.t = j
e.q = f
e.p = g
f.w = h
f.x = g
j.v = e
j.z = e
j.o = m
h.p = l
h.v = m
h.z = e
l.x = m
l.s = m
l.p = h
l.q = h
l.u = h
assert j.o.v.r.p.p.u.z.txt == "e"