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

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

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

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

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

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

class G:
    def __init__(self, txt: str):
        self.w: D = None
        self.t: E = None
        self.q: E = None
        self.u: G = None
        self.txt = txt

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

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

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

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

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

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

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

class G:
    def __init__(self, txt: str):
        self.w: D = None
        self.t: E = None
        self.q: E = None
        self.u: G = None
        self.txt = txt

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

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