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

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

class C:
    def __init__(self, txt: str):
        self.z: D = None
        self.txt = txt

class D:
    def __init__(self, txt: str):
        self.o: E = None
        self.p: G = None
        self.z: F = None
        self.q: G = None
        self.v: D = None
        self.txt = txt

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

class F:
    def __init__(self, txt: str):
        self.p: G = None
        self.q: E = None
        self.txt = txt

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

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

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

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

class C:
    def __init__(self, txt: str):
        self.z: D = None
        self.txt = txt

class D:
    def __init__(self, txt: str):
        self.o: E = None
        self.p: G = None
        self.z: F = None
        self.q: G = None
        self.v: D = None
        self.txt = txt

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

class F:
    def __init__(self, txt: str):
        self.p: G = None
        self.q: E = None
        self.txt = txt

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

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

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