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

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

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

class D:
    def __init__(self, txt: str):
        self.y: C = None
        self.txt = txt

class E:
    def __init__(self, txt: str):
        self.z: C = None
        self.s: A = None
        self.y: F = None
        self.x: A = None
        self.txt = txt

class F:
    def __init__(self, txt: str):
        self.r: B = None
        self.z: E = None
        self.x: E = None
        self.txt = txt

b = A("b")
c = B("c")
i = C("i")
g = D("g")
l = E("l")
k = F("k")

b.v = g
c.t = k
c.u = b
c.y = b
i.y = b
i.p = b
i.x = l
i.s = l
i.w = c
g.y = i
l.z = i
l.s = b
l.x = b
l.y = k
k.r = c
k.z = l
k.x = l
assert i.s.y.r.u.txt == "
class A:
    def __init__(self, txt: str):
        self.v: D = None
        self.txt = txt

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

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

class D:
    def __init__(self, txt: str):
        self.y: C = None
        self.txt = txt

class E:
    def __init__(self, txt: str):
        self.z: C = None
        self.s: A = None
        self.y: F = None
        self.x: A = None
        self.txt = txt

class F:
    def __init__(self, txt: str):
        self.r: B = None
        self.z: E = None
        self.x: E = None
        self.txt = txt

b = A("b")
c = B("c")
i = C("i")
g = D("g")
l = E("l")
k = F("k")

b.v = g
c.t = k
c.u = b
c.y = b
i.y = b
i.p = b
i.x = l
i.s = l
i.w = c
g.y = i
l.z = i
l.s = b
l.x = b
l.y = k
k.r = c
k.z = l
k.x = l
assert i.s.y.r.u.txt == "b"