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

class B:
    def __init__(self, txt: str):
        self.p: A = None
        self.u: G = None
        self.r: E = None
        self.txt = txt

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

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

class E:
    def __init__(self, txt: str):
        self.t: A = None
        self.s: A = None
        self.r: B = None
        self.v: D = None
        self.o: G = None
        self.w: F = None
        self.y: D = None
        self.txt = txt

class F:
    def __init__(self, txt: str):
        self.t: E = None
        self.x: C = None
        self.txt = txt

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

g = A("g")
n = B("n")
e = C("e")
k = D("k")
b = E("b")
m = F("m")
f = G("f")
c = B("c")
h = E("h")
l = B("l")

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

class B:
    def __init__(self, txt: str):
        self.p: A = None
        self.u: G = None
        self.r: E = None
        self.txt = txt

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

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

class E:
    def __init__(self, txt: str):
        self.t: A = None
        self.s: A = None
        self.r: B = None
        self.v: D = None
        self.o: G = None
        self.w: F = None
        self.y: D = None
        self.txt = txt

class F:
    def __init__(self, txt: str):
        self.t: E = None
        self.x: C = None
        self.txt = txt

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

g = A("g")
n = B("n")
e = C("e")
k = D("k")
b = E("b")
m = F("m")
f = G("f")
c = B("c")
h = E("h")
l = B("l")

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