class A:
    def __init__(self, txt: str):
        self.v: E = None
        self.y: G = None
        self.t: C = None
        self.txt = txt

class B:
    def __init__(self, txt: str):
        self.w: G = None
        self.txt = txt

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

class D:
    def __init__(self, txt: str):
        self.p: C = None
        self.q: G = None
        self.txt = txt

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

class F:
    def __init__(self, txt: str):
        self.s: A = None
        self.v: A = None
        self.y: B = None
        self.p: D = None
        self.txt = txt

class G:
    def __init__(self, txt: str):
        self.q: B = None
        self.o: B = None
        self.r: E = None
        self.v: B = None
        self.txt = txt

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

l.v = i
l.y = k
l.t = b
e.w = k
b.t = c
f.p = b
f.q = k
i.p = c
i.s = f
i.o = f
i.x = k
i.y = e
c.s = l
c.v = l
c.y = e
c.p = f
k.q = e
k.o = e
k.v = e
k.r = i
assert l.y.v.w.txt == "
class A:
    def __init__(self, txt: str):
        self.v: E = None
        self.y: G = None
        self.t: C = None
        self.txt = txt

class B:
    def __init__(self, txt: str):
        self.w: G = None
        self.txt = txt

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

class D:
    def __init__(self, txt: str):
        self.p: C = None
        self.q: G = None
        self.txt = txt

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

class F:
    def __init__(self, txt: str):
        self.s: A = None
        self.v: A = None
        self.y: B = None
        self.p: D = None
        self.txt = txt

class G:
    def __init__(self, txt: str):
        self.q: B = None
        self.o: B = None
        self.r: E = None
        self.v: B = None
        self.txt = txt

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

l.v = i
l.y = k
l.t = b
e.w = k
b.t = c
f.p = b
f.q = k
i.p = c
i.s = f
i.o = f
i.x = k
i.y = e
c.s = l
c.v = l
c.y = e
c.p = f
k.q = e
k.o = e
k.v = e
k.r = i
assert l.y.v.w.txt == "k"