class A:
    def __init__(self, txt: str):
        self.y: D = None
        self.r: E = None
        self.t: F = None
        self.u: F = None
        self.w: C = None
        self.txt = txt

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

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

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

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

class F:
    def __init__(self, txt: str):
        self.z: C = None
        self.o: A = None
        self.s: B = None
        self.q: B = None
        self.txt = txt

d = A("d")
g = B("g")
e = C("e")
f = D("f")
c = E("c")
l = F("l")
k = D("k")

d.y = k
d.r = c
d.t = l
d.u = l
d.w = e
g.u = e
g.t = l
e.v = l
e.t = d
f.x = d
c.v = f
l.z = e
l.o = d
l.s = g
l.q = g
k.x = d
assert c.v.x.r.txt == "
class A:
    def __init__(self, txt: str):
        self.y: D = None
        self.r: E = None
        self.t: F = None
        self.u: F = None
        self.w: C = None
        self.txt = txt

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

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

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

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

class F:
    def __init__(self, txt: str):
        self.z: C = None
        self.o: A = None
        self.s: B = None
        self.q: B = None
        self.txt = txt

d = A("d")
g = B("g")
e = C("e")
f = D("f")
c = E("c")
l = F("l")
k = D("k")

d.y = k
d.r = c
d.t = l
d.u = l
d.w = e
g.u = e
g.t = l
e.v = l
e.t = d
f.x = d
c.v = f
l.z = e
l.o = d
l.s = g
l.q = g
k.x = d
assert c.v.x.r.txt == "c"