class A:
    def __init__(self, txt: str):
        self.s: C = None
        self.txt = txt

class B:
    def __init__(self, txt: str):
        self.u: G = None
        self.r: C = None
        self.t: C = None
        self.o: E = None
        self.txt = txt

class C:
    def __init__(self, txt: str):
        self.r: D = None
        self.x: B = None
        self.p: A = None
        self.z: D = None
        self.v: B = None
        self.u: E = None
        self.txt = txt

class D:
    def __init__(self, txt: str):
        self.v: G = None
        self.z: B = None
        self.x: B = None
        self.u: G = None
        self.y: G = None
        self.w: B = None
        self.txt = txt

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

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

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

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

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

class B:
    def __init__(self, txt: str):
        self.u: G = None
        self.r: C = None
        self.t: C = None
        self.o: E = None
        self.txt = txt

class C:
    def __init__(self, txt: str):
        self.r: D = None
        self.x: B = None
        self.p: A = None
        self.z: D = None
        self.v: B = None
        self.u: E = None
        self.txt = txt

class D:
    def __init__(self, txt: str):
        self.v: G = None
        self.z: B = None
        self.x: B = None
        self.u: G = None
        self.y: G = None
        self.w: B = None
        self.txt = txt

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

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

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

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

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