class A:
    def __init__(self, txt: str):
        self.r: G = None
        self.t: F = None
        self.p: C = None
        self.w: D = None
        self.s: F = None
        self.v: E = None
        self.txt = txt

class B:
    def __init__(self, txt: str):
        self.r: F = None
        self.s: A = None
        self.y: G = None
        self.v: D = None
        self.z: G = None
        self.q: E = None
        self.txt = txt

class C:
    def __init__(self, txt: str):
        self.w: B = None
        self.txt = txt

class D:
    def __init__(self, txt: str):
        self.z: F = None
        self.x: C = None
        self.o: E = None
        self.y: C = None
        self.v: B = None
        self.s: C = None
        self.txt = txt

class E:
    def __init__(self, txt: str):
        self.w: G = None
        self.z: B = None
        self.y: A = None
        self.s: G = None
        self.v: F = None
        self.txt = txt

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

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

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

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

class B:
    def __init__(self, txt: str):
        self.r: F = None
        self.s: A = None
        self.y: G = None
        self.v: D = None
        self.z: G = None
        self.q: E = None
        self.txt = txt

class C:
    def __init__(self, txt: str):
        self.w: B = None
        self.txt = txt

class D:
    def __init__(self, txt: str):
        self.z: F = None
        self.x: C = None
        self.o: E = None
        self.y: C = None
        self.v: B = None
        self.s: C = None
        self.txt = txt

class E:
    def __init__(self, txt: str):
        self.w: G = None
        self.z: B = None
        self.y: A = None
        self.s: G = None
        self.v: F = None
        self.txt = txt

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

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

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

b.r = i
b.t = k
b.s = k
b.p = f
b.w = e
b.v = h
g.r = k
g.s = b
g.y = i
g.z = i
g.v = e
g.q = h
f.w = g
e.z = k
e.x = f
e.y = f
e.s = f
e.o = h
e.v = g
h.w = i
h.s = i
h.z = g
h.y = b
h.v = k
k.v = b
i.r = k
assert k.v.v.y.txt == "b"