class A:
    def __init__(self, txt: str):
        self.u: B = None
        self.v: D = None
        self.r: B = None
        self.t: C = None
        self.txt = txt

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

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

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

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

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

g = A("g")
m = B("m")
h = C("h")
c = D("c")
b = E("b")
d = F("d")
e = D("e")
j = D("j")
f = A("f")

g.u = m
g.r = m
g.v = j
g.t = h
m.v = d
h.s = b
h.r = d
h.p = d
h.t = m
h.y = m
c.u = h
c.s = h
c.q = h
c.x = b
b.u = h
b.x = e
b.w = e
d.y = f
d.r = g
d.s = h
d.q = h
d.u = b
e.u = h
e.s = h
e.q = h
e.x = b
j.u = h
j.s = h
j.q = h
j.x = b
f.u = m
f.r = m
f.v = e
f.t = h
assert g.t.r.s.s.u.s.u.r.q.txt == "
class A:
    def __init__(self, txt: str):
        self.u: B = None
        self.v: D = None
        self.r: B = None
        self.t: C = None
        self.txt = txt

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

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

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

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

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

g = A("g")
m = B("m")
h = C("h")
c = D("c")
b = E("b")
d = F("d")
e = D("e")
j = D("j")
f = A("f")

g.u = m
g.r = m
g.v = j
g.t = h
m.v = d
h.s = b
h.r = d
h.p = d
h.t = m
h.y = m
c.u = h
c.s = h
c.q = h
c.x = b
b.u = h
b.x = e
b.w = e
d.y = f
d.r = g
d.s = h
d.q = h
d.u = b
e.u = h
e.s = h
e.q = h
e.x = b
j.u = h
j.s = h
j.q = h
j.x = b
f.u = m
f.r = m
f.v = e
f.t = h
assert g.t.r.s.s.u.s.u.r.q.txt == "h"