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

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

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

class D:
    def __init__(self, txt: str):
        self.w: E = None
        self.z: E = None
        self.t: A = None
        self.txt = txt

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

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

class G:
    def __init__(self, txt: str):
        self.y: A = None
        self.v: A = None
        self.o: C = None
        self.x: B = None
        self.q: D = None
        self.s: B = None
        self.txt = txt

b = A("b")
h = B("h")
g = C("g")
k = D("k")
n = E("n")
m = F("m")
i = G("i")
d = B("d")

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

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

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

class D:
    def __init__(self, txt: str):
        self.w: E = None
        self.z: E = None
        self.t: A = None
        self.txt = txt

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

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

class G:
    def __init__(self, txt: str):
        self.y: A = None
        self.v: A = None
        self.o: C = None
        self.x: B = None
        self.q: D = None
        self.s: B = None
        self.txt = txt

b = A("b")
h = B("h")
g = C("g")
k = D("k")
n = E("n")
m = F("m")
i = G("i")
d = B("d")

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