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

class B:
    def __init__(self, txt: str):
        self.z: F = None
        self.txt = txt

class C:
    def __init__(self, txt: str):
        self.r: D = None
        self.txt = txt

class D:
    def __init__(self, txt: str):
        self.p: E = None
        self.r: G = None
        self.o: E = None
        self.q: G = None
        self.w: C = None
        self.x: C = None
        self.txt = txt

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

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

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

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

h.z = e
h.v = e
h.s = j
h.t = j
h.q = g
e.z = j
b.r = k
k.p = l
k.o = l
k.r = g
k.q = g
k.w = b
k.x = b
l.y = b
l.o = g
j.q = k
j.u = h
j.o = h
j.v = g
j.s = g
g.x = l
g.z = k
g.v = k
g.u = h
assert l.y.r.o.y.r.p.o.txt == "
class A:
    def __init__(self, txt: str):
        self.z: B = None
        self.s: F = None
        self.q: G = None
        self.t: F = None
        self.v: B = None
        self.txt = txt

class B:
    def __init__(self, txt: str):
        self.z: F = None
        self.txt = txt

class C:
    def __init__(self, txt: str):
        self.r: D = None
        self.txt = txt

class D:
    def __init__(self, txt: str):
        self.p: E = None
        self.r: G = None
        self.o: E = None
        self.q: G = None
        self.w: C = None
        self.x: C = None
        self.txt = txt

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

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

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

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

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