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

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

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

class D:
    def __init__(self, txt: str):
        self.v: F = None
        self.o: B = None
        self.x: A = None
        self.t: A = None
        self.p: G = None
        self.u: C = None
        self.z: B = None
        self.txt = txt

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

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

class G:
    def __init__(self, txt: str):
        self.x: D = None
        self.z: A = None
        self.txt = txt

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

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

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

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

class D:
    def __init__(self, txt: str):
        self.v: F = None
        self.o: B = None
        self.x: A = None
        self.t: A = None
        self.p: G = None
        self.u: C = None
        self.z: B = None
        self.txt = txt

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

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

class G:
    def __init__(self, txt: str):
        self.x: D = None
        self.z: A = None
        self.txt = txt

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

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