class A:
    def __init__(self, txt: str):
        self.o: G = None
        self.p: D = None
        self.q: B = None
        self.txt = txt

class B:
    def __init__(self, txt: str):
        self.u: D = None
        self.txt = txt

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

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

class E:
    def __init__(self, txt: str):
        self.q: D = None
        self.x: C = None
        self.y: F = None
        self.z: F = None
        self.o: B = None
        self.w: G = None
        self.txt = txt

class F:
    def __init__(self, txt: str):
        self.x: G = None
        self.txt = txt

class G:
    def __init__(self, txt: str):
        self.x: F = None
        self.txt = txt

h = A("h")
n = B("n")
g = C("g")
j = D("j")
d = E("d")
l = F("l")
b = G("b")
i = B("i")

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

class B:
    def __init__(self, txt: str):
        self.u: D = None
        self.txt = txt

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

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

class E:
    def __init__(self, txt: str):
        self.q: D = None
        self.x: C = None
        self.y: F = None
        self.z: F = None
        self.o: B = None
        self.w: G = None
        self.txt = txt

class F:
    def __init__(self, txt: str):
        self.x: G = None
        self.txt = txt

class G:
    def __init__(self, txt: str):
        self.x: F = None
        self.txt = txt

h = A("h")
n = B("n")
g = C("g")
j = D("j")
d = E("d")
l = F("l")
b = G("b")
i = B("i")

h.o = b
h.p = j
h.q = i
n.u = j
g.v = b
g.w = l
g.y = l
j.s = i
j.o = d
j.r = h
d.q = j
d.x = g
d.y = l
d.z = l
d.o = n
d.w = b
l.x = b
b.x = l
i.u = j
assert i.u.s.u.o.o.u.txt == "j"