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

class B:
    def __init__(self, txt: str):
        self.y: F = None
        self.t: E = None
        self.w: E = None
        self.s: D = None
        self.x: E = None
        self.r: F = None
        self.txt = txt

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

class D:
    def __init__(self, txt: str):
        self.x: B = None
        self.q: E = None
        self.v: F = None
        self.txt = txt

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

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

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

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

class B:
    def __init__(self, txt: str):
        self.y: F = None
        self.t: E = None
        self.w: E = None
        self.s: D = None
        self.x: E = None
        self.r: F = None
        self.txt = txt

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

class D:
    def __init__(self, txt: str):
        self.x: B = None
        self.q: E = None
        self.v: F = None
        self.txt = txt

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

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

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

l.x = i
l.r = i
l.v = m
k.y = g
k.r = g
k.t = i
k.w = i
k.x = i
k.s = c
b.y = g
c.x = k
c.q = i
c.v = g
i.w = k
i.s = l
i.y = b
g.y = i
g.t = k
m.x = k
m.q = i
m.v = g
assert k.s.v.t.y.t.r.txt == "g"