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

class B:
    def __init__(self, txt: str):
        self.t: D = None
        self.txt = txt

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

class D:
    def __init__(self, txt: str):
        self.w: B = None
        self.v: F = None
        self.u: F = None
        self.txt = txt

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

class F:
    def __init__(self, txt: str):
        self.u: G = None
        self.s: E = None
        self.w: B = None
        self.q: A = None
        self.y: C = None
        self.x: B = None
        self.o: C = None
        self.txt = txt

class G:
    def __init__(self, txt: str):
        self.t: A = None
        self.v: D = None
        self.x: D = None
        self.o: E = None
        self.r: F = None
        self.q: D = None
        self.txt = txt

k = A("k")
d = B("d")
j = C("j")
a = D("a")
h = E("h")
l = F("l")
f = G("f")

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

class B:
    def __init__(self, txt: str):
        self.t: D = None
        self.txt = txt

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

class D:
    def __init__(self, txt: str):
        self.w: B = None
        self.v: F = None
        self.u: F = None
        self.txt = txt

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

class F:
    def __init__(self, txt: str):
        self.u: G = None
        self.s: E = None
        self.w: B = None
        self.q: A = None
        self.y: C = None
        self.x: B = None
        self.o: C = None
        self.txt = txt

class G:
    def __init__(self, txt: str):
        self.t: A = None
        self.v: D = None
        self.x: D = None
        self.o: E = None
        self.r: F = None
        self.q: D = None
        self.txt = txt

k = A("k")
d = B("d")
j = C("j")
a = D("a")
h = E("h")
l = F("l")
f = G("f")

k.x = a
k.u = l
k.q = h
d.t = a
j.x = l
j.v = l
j.u = k
a.w = d
a.v = l
a.u = l
h.o = d
h.r = f
l.u = f
l.s = h
l.w = d
l.x = d
l.q = k
l.y = j
l.o = j
f.t = k
f.v = a
f.x = a
f.q = a
f.o = h
f.r = l
assert k.x.w.t.txt == "a"