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

class B:
    def __init__(self, txt: str):
        self.r: F = None
        self.o: D = None
        self.v: A = None
        self.q: D = None
        self.u: F = None
        self.p: F = None
        self.txt = txt

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

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

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

class F:
    def __init__(self, txt: str):
        self.z: A = None
        self.r: E = None
        self.q: D = None
        self.u: C = None
        self.v: E = None
        self.p: B = None
        self.txt = txt

class G:
    def __init__(self, txt: str):
        self.y: B = None
        self.t: D = None
        self.z: C = None
        self.x: A = None
        self.txt = txt

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

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

class B:
    def __init__(self, txt: str):
        self.r: F = None
        self.o: D = None
        self.v: A = None
        self.q: D = None
        self.u: F = None
        self.p: F = None
        self.txt = txt

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

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

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

class F:
    def __init__(self, txt: str):
        self.z: A = None
        self.r: E = None
        self.q: D = None
        self.u: C = None
        self.v: E = None
        self.p: B = None
        self.txt = txt

class G:
    def __init__(self, txt: str):
        self.y: B = None
        self.t: D = None
        self.z: C = None
        self.x: A = None
        self.txt = txt

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

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