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

class B:
    def __init__(self, txt: str):
        self.y: G = None
        self.w: C = None
        self.q: F = None
        self.s: C = None
        self.z: G = None
        self.u: E = None
        self.v: A = None
        self.txt = txt

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

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

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

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

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

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

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

class B:
    def __init__(self, txt: str):
        self.y: G = None
        self.w: C = None
        self.q: F = None
        self.s: C = None
        self.z: G = None
        self.u: E = None
        self.v: A = None
        self.txt = txt

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

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

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

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

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

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

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