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

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

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

class D:
    def __init__(self, txt: str):
        self.t: F = None
        self.w: C = None
        self.o: G = None
        self.y: F = None
        self.v: G = None
        self.txt = txt

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

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

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

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

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

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

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

class D:
    def __init__(self, txt: str):
        self.t: F = None
        self.w: C = None
        self.o: G = None
        self.y: F = None
        self.v: G = None
        self.txt = txt

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

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

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

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

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