class A:
    def __init__(self, txt: str):
        self.s: B = None
        self.x: B = None
        self.w: A = None
        self.o: E = None
        self.y: C = None
        self.p: G = None
        self.r: C = None
        self.txt = txt

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

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

class D:
    def __init__(self, txt: str):
        self.p: A = None
        self.y: F = None
        self.w: C = None
        self.x: E = None
        self.q: C = None
        self.v: F = None
        self.txt = txt

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

class F:
    def __init__(self, txt: str):
        self.v: C = None
        self.y: E = None
        self.r: A = None
        self.txt = txt

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

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

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

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

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

class D:
    def __init__(self, txt: str):
        self.p: A = None
        self.y: F = None
        self.w: C = None
        self.x: E = None
        self.q: C = None
        self.v: F = None
        self.txt = txt

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

class F:
    def __init__(self, txt: str):
        self.v: C = None
        self.y: E = None
        self.r: A = None
        self.txt = txt

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

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

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