class A:
    def __init__(self, txt: str):
        self.v: B = None
        self.txt = txt

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

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

class D:
    def __init__(self, txt: str):
        self.p: A = None
        self.z: B = None
        self.txt = txt

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

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

g = A("g")
a = B("a")
c = C("c")
h = D("h")
e = E("e")
b = F("b")
i = F("i")

g.v = a
a.r = h
a.z = h
a.t = h
a.x = c
a.v = g
c.s = g
h.p = g
h.z = a
e.o = i
e.r = c
e.t = a
b.r = c
b.y = i
b.t = i
b.q = i
b.v = g
b.x = g
i.r = c
i.y = b
i.t = b
i.q = b
i.v = g
i.x = g
assert e.r.s.v.x.s.v.txt == "
class A:
    def __init__(self, txt: str):
        self.v: B = None
        self.txt = txt

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

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

class D:
    def __init__(self, txt: str):
        self.p: A = None
        self.z: B = None
        self.txt = txt

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

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

g = A("g")
a = B("a")
c = C("c")
h = D("h")
e = E("e")
b = F("b")
i = F("i")

g.v = a
a.r = h
a.z = h
a.t = h
a.x = c
a.v = g
c.s = g
h.p = g
h.z = a
e.o = i
e.r = c
e.t = a
b.r = c
b.y = i
b.t = i
b.q = i
b.v = g
b.x = g
i.r = c
i.y = b
i.t = b
i.q = b
i.v = g
i.x = g
assert e.r.s.v.x.s.v.txt == "a"