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

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

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

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

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

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

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

n = A("n")
m = B("m")
f = C("f")
g = D("g")
l = E("l")
d = F("d")
c = G("c")
j = B("j")

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

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

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

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

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

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

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

n = A("n")
m = B("m")
f = C("f")
g = D("g")
l = E("l")
d = F("d")
c = G("c")
j = B("j")

n.u = g
n.v = c
m.y = f
m.p = f
m.v = d
m.x = c
m.q = c
f.s = g
g.o = c
g.x = c
g.s = m
g.v = n
g.w = n
g.z = d
g.q = j
l.t = g
l.v = g
l.r = m
d.r = l
d.y = l
d.o = n
c.o = n
c.w = g
j.y = f
j.p = f
j.v = d
j.x = c
j.q = c
assert d.o.u.w.u.x.txt == "c"