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

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

class C:
    def __init__(self, txt: str):
        self.o: A = None
        self.p: A = None
        self.v: E = None
        self.t: E = None
        self.txt = txt

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

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

class F:
    def __init__(self, txt: str):
        self.z: B = None
        self.t: D = None
        self.w: C = None
        self.r: E = None
        self.p: A = None
        self.u: E = None
        self.y: C = None
        self.txt = txt

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

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

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

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

class C:
    def __init__(self, txt: str):
        self.o: A = None
        self.p: A = None
        self.v: E = None
        self.t: E = None
        self.txt = txt

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

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

class F:
    def __init__(self, txt: str):
        self.z: B = None
        self.t: D = None
        self.w: C = None
        self.r: E = None
        self.p: A = None
        self.u: E = None
        self.y: C = None
        self.txt = txt

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

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

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