class A:
    def __init__(self, txt: str):
        self.z: F = None
        self.txt = txt

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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