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

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

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

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

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

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

class G:
    def __init__(self, txt: str):
        self.z: D = None
        self.y: C = None
        self.r: D = None
        self.o: C = None
        self.t: C = None
        self.s: F = None
        self.p: E = None
        self.txt = txt

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

i.q = c
b.r = g
b.q = e
b.y = c
e.w = g
f.z = h
f.s = h
f.r = h
f.q = g
f.y = i
f.t = c
c.t = b
a.z = f
a.u = e
a.r = c
a.s = i
a.q = i
g.z = f
g.r = f
g.y = e
g.o = e
g.t = e
g.s = a
g.p = c
h.z = f
h.s = f
h.r = f
h.q = g
h.y = i
h.t = c
assert c.t.y.t.txt == "
class A:
    def __init__(self, txt: str):
        self.q: E = None
        self.txt = txt

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

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

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

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

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

class G:
    def __init__(self, txt: str):
        self.z: D = None
        self.y: C = None
        self.r: D = None
        self.o: C = None
        self.t: C = None
        self.s: F = None
        self.p: E = None
        self.txt = txt

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

i.q = c
b.r = g
b.q = e
b.y = c
e.w = g
f.z = h
f.s = h
f.r = h
f.q = g
f.y = i
f.t = c
c.t = b
a.z = f
a.u = e
a.r = c
a.s = i
a.q = i
g.z = f
g.r = f
g.y = e
g.o = e
g.t = e
g.s = a
g.p = c
h.z = f
h.s = f
h.r = f
h.q = g
h.y = i
h.t = c
assert c.t.y.t.txt == "b"