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

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

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

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

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

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

class G:
    def __init__(self, txt: str):
        self.p: F = None
        self.y: C = None
        self.w: F = None
        self.z: A = None
        self.txt = txt

d = A("d")
f = B("f")
n = C("n")
k = D("k")
h = E("h")
c = F("c")
i = G("i")
b = A("b")
a = F("a")

d.r = f
d.t = i
d.z = c
f.q = k
f.s = d
f.x = h
n.s = c
n.w = f
n.x = d
k.p = n
h.v = n
h.s = a
h.u = i
c.y = f
c.s = k
c.x = k
c.t = h
c.u = b
i.p = c
i.y = n
i.w = a
i.z = b
b.r = f
b.t = i
b.z = c
a.y = f
a.s = k
a.x = k
a.t = h
a.u = d
assert c.t.v.s.t.s.u.txt == "
class A:
    def __init__(self, txt: str):
        self.r: B = None
        self.t: G = None
        self.z: F = None
        self.txt = txt

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

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

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

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

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

class G:
    def __init__(self, txt: str):
        self.p: F = None
        self.y: C = None
        self.w: F = None
        self.z: A = None
        self.txt = txt

d = A("d")
f = B("f")
n = C("n")
k = D("k")
h = E("h")
c = F("c")
i = G("i")
b = A("b")
a = F("a")

d.r = f
d.t = i
d.z = c
f.q = k
f.s = d
f.x = h
n.s = c
n.w = f
n.x = d
k.p = n
h.v = n
h.s = a
h.u = i
c.y = f
c.s = k
c.x = k
c.t = h
c.u = b
i.p = c
i.y = n
i.w = a
i.z = b
b.r = f
b.t = i
b.z = c
a.y = f
a.s = k
a.x = k
a.t = h
a.u = d
assert c.t.v.s.t.s.u.txt == "d"