class A:
    def __init__(self, txt: str):
        self.o: C = None
        self.t: B = None
        self.w: C = None
        self.u: G = None
        self.r: G = None
        self.v: B = None
        self.s: G = None
        self.txt = txt

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

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

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

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

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

class G:
    def __init__(self, txt: str):
        self.r: F = None
        self.s: B = None
        self.x: A = None
        self.y: F = None
        self.txt = txt

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

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

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

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

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

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

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

class G:
    def __init__(self, txt: str):
        self.r: F = None
        self.s: B = None
        self.x: A = None
        self.y: F = None
        self.txt = txt

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

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