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

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

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

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

class E:
    def __init__(self, txt: str):
        self.x: A = None
        self.v: A = None
        self.y: G = None
        self.p: F = None
        self.r: B = None
        self.txt = txt

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

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

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

d.v = k
d.y = k
e.s = k
e.y = h
e.u = b
e.q = a
e.r = a
b.s = a
b.r = a
b.u = k
a.s = h
a.r = b
k.x = d
k.v = d
k.y = c
k.p = h
k.r = e
h.q = e
h.t = d
c.u = k
c.w = d
c.s = h
assert e.q.s.q.u.txt == "
class A:
    def __init__(self, txt: str):
        self.v: E = None
        self.y: E = None
        self.txt = txt

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

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

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

class E:
    def __init__(self, txt: str):
        self.x: A = None
        self.v: A = None
        self.y: G = None
        self.p: F = None
        self.r: B = None
        self.txt = txt

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

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

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

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