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

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

class C:
    def __init__(self, txt: str):
        self.u: B = None
        self.r: D = None
        self.txt = txt

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

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

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

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

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

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

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

class C:
    def __init__(self, txt: str):
        self.u: B = None
        self.r: D = None
        self.txt = txt

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

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

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

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

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

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