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

class B:
    def __init__(self, txt: str):
        self.y: A = None
        self.t: E = None
        self.r: C = None
        self.x: E = None
        self.txt = txt

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

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

class E:
    def __init__(self, txt: str):
        self.q: F = None
        self.w: B = None
        self.u: B = None
        self.r: G = None
        self.txt = txt

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

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

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

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

class B:
    def __init__(self, txt: str):
        self.y: A = None
        self.t: E = None
        self.r: C = None
        self.x: E = None
        self.txt = txt

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

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

class E:
    def __init__(self, txt: str):
        self.q: F = None
        self.w: B = None
        self.u: B = None
        self.r: G = None
        self.txt = txt

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

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

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

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