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

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

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

class D:
    def __init__(self, txt: str):
        self.r: A = None
        self.y: F = None
        self.x: E = None
        self.z: C = None
        self.w: E = None
        self.s: C = None
        self.txt = txt

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

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

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

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

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

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

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

class D:
    def __init__(self, txt: str):
        self.r: A = None
        self.y: F = None
        self.x: E = None
        self.z: C = None
        self.w: E = None
        self.s: C = None
        self.txt = txt

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

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

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

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

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