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

class B:
    def __init__(self, txt: str):
        self.z: G = None
        self.v: A = None
        self.s: G = None
        self.r: F = None
        self.o: C = None
        self.txt = txt

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

class D:
    def __init__(self, txt: str):
        self.w: G = None
        self.o: F = None
        self.s: E = None
        self.u: G = None
        self.txt = txt

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

class F:
    def __init__(self, txt: str):
        self.q: A = None
        self.x: E = None
        self.o: D = None
        self.u: G = None
        self.txt = txt

class G:
    def __init__(self, txt: str):
        self.x: A = None
        self.v: E = None
        self.p: C = None
        self.o: G = None
        self.w: B = None
        self.txt = txt

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

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

class B:
    def __init__(self, txt: str):
        self.z: G = None
        self.v: A = None
        self.s: G = None
        self.r: F = None
        self.o: C = None
        self.txt = txt

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

class D:
    def __init__(self, txt: str):
        self.w: G = None
        self.o: F = None
        self.s: E = None
        self.u: G = None
        self.txt = txt

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

class F:
    def __init__(self, txt: str):
        self.q: A = None
        self.x: E = None
        self.o: D = None
        self.u: G = None
        self.txt = txt

class G:
    def __init__(self, txt: str):
        self.x: A = None
        self.v: E = None
        self.p: C = None
        self.o: G = None
        self.w: B = None
        self.txt = txt

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

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